fix: Link toolbar update error #1486
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an bug with the link toolbar, where
mouseHoveredLinkMark
may be defined even when the mouse cursor isn't hovering any links. This is because the plugin would check if a link is currently hovered by the keyboard or mouse on every state update. State updates may cause the link under the mouse cursor move or be removed outright (such as moving blocks up & down, where it's briefly removed when replacing blocks). However, as nomouseover
event is fired,mouseHoveredLinkMark
doesn't get cleared and so an error is thrown if the link doesn't exist.Therefore, this PR changes the behaviour so that only
keyboardHoveredLinkMark
is considered when updating the link toolbar, unless the update was explicitly called by themouseover
handler.Closes #1479