From 859a95d1d165ca8cafd0a51b4707191e5b80a6df Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 4 Jan 2023 23:07:58 -0800 Subject: [PATCH] Fix select of text. --- .../components/action-widget/pane/topic-link/index.tsx | 5 +++-- packages/mindplot/src/components/MultilineTextEditor.ts | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/editor/src/components/action-widget/pane/topic-link/index.tsx b/packages/editor/src/components/action-widget/pane/topic-link/index.tsx index d529523a..dd75524d 100644 --- a/packages/editor/src/components/action-widget/pane/topic-link/index.tsx +++ b/packages/editor/src/components/action-widget/pane/topic-link/index.tsx @@ -77,18 +77,19 @@ const TopicLink = (props: { onChange={(event) => setUrl(event.target.value)} variant="outlined" size="small" + type="url" onKeyDown={keyDownHandler} InputProps={{ endAdornment: ( - + ), }} margin="dense" - > + />
, selectText: boolean) { const { length } = this.getTextAreaText(); const start = selectText ? 0 : length; + textareaElem.trigger('focus'); textareaElem[0].setSelectionRange(start, length); }