Skip to content

Commit

Permalink
fix: link on web
Browse files Browse the repository at this point in the history
  • Loading branch information
17Amir17 committed Oct 24, 2024
1 parent 98eb4ae commit dddbfbb
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 dddbfbb

Please sign in to comment.