Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection is not handled properly while setting selected text #1265

Open
Losses opened this issue Sep 28, 2021 · 5 comments
Open

Selection is not handled properly while setting selected text #1265

Losses opened this issue Sep 28, 2021 · 5 comments
Assignees
Labels
type: bug 🪲 Something isn't working

Comments

@Losses
Copy link

Losses commented Sep 28, 2021

Summary

When the style setting is triggered, the size of the highlighted selection area will change.

Steps to reproduce

  1. Input something on remirror's official demo
  2. Set some text to bold

Expected results

Only selected text turns bold, and selected

Actual results

Other text also selected

Possible Solution

Related code:

export function getTextSelection(

Screenshot(s)

selection-bug

Credit

This bug is found by @Rolaka

@Losses Losses added the type: bug 🪲 Something isn't working label Sep 28, 2021
@ocavue ocavue self-assigned this Oct 1, 2021
@ocavue
Copy link
Member

ocavue commented Oct 1, 2021

This is a weird bug. The selected part is wrapped in a <span class="selection"> inline decoration, which provide the background. But the DOM structure shows that this decoration should only include characters we want.

CleanShot 2021-10-02 at 00 59 22

Although I don't know what the reason is, if #1282 is passed, then this bug will be fixed along with it.


I don't see the relation between this bug and the function getTextSelection. This function won't be called when you set some text bold.

@chunkzer
Copy link

Is this issue still outstanding? I could not reproduce it based on the initial description.

@tomas-c
Copy link
Contributor

tomas-c commented Feb 10, 2022

Not sure if this is exactly the same issue but if I go to https://remirror.io/ using Chrome and bold some selected text, the selection disappears:

selection-changes.mp4

@chunkzer
Copy link

Not sure if this is exactly the same issue but I go to https://remirror.io/ using Chrome and bold some selected text, the selection disappears:

selection-changes.mp4

I think selection disappearing is due to losing focus by clicking on the bold button. (You don't lose focus if you hotkey into it.)

@tomas-c
Copy link
Contributor

tomas-c commented Feb 10, 2022

It does not always disappear when clicking on the buttons, another example:

selection-jumping-floating-toolbard.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants