Skip to content

Commit

Permalink
Merge pull request #215 from 10play/fix-web-link
Browse files Browse the repository at this point in the history
fix: link on web
  • Loading branch information
17Amir17 authored Oct 24, 2024
2 parents 98eb4ae + dddbfbb commit d567073
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/RichText/Toolbar/Toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,17 @@ export function Toolbar({
<EditLinkBar
theme={editor.theme}
initialLink={editorState.activeLink}
onBlur={() => setToolbarContext(ToolbarContext.Main)}
onBlur={() => {
if (Platform.OS === 'web') {
// On web blur is called before onEditLink. This isn't an ideal fix however this is going to be change soon when we
// add the new api for toolbar where we will have more control. This is a temporary fix for now.
setTimeout(() => {
setToolbarContext(ToolbarContext.Main);
}, 100);
} else {
setToolbarContext(ToolbarContext.Main);
}
}}
onLinkIconClick={() => {
setToolbarContext(ToolbarContext.Main);
editor.focus();
Expand Down

0 comments on commit d567073

Please sign in to comment.