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

Editable mentions don't support exiting when text selected #640

Closed
ifiokjr opened this issue Sep 4, 2020 · 0 comments · Fixed by #658
Closed

Editable mentions don't support exiting when text selected #640

ifiokjr opened this issue Sep 4, 2020 · 0 comments · Fixed by #658
Assignees
Labels
good first issue Good for newcomers package: remirror 🟣 Label for the remirror package and all relevant scoped `@remirror/*` packages. priority: high 🔼 This should be prioritised and completed soon. status: confirmed 🟢 The bug has been tested and confirmed. type: bug 🪲 Something isn't working

Comments

@ifiokjr
Copy link
Member

ifiokjr commented Sep 4, 2020

Summary

Showcase Link

Related to #639

Mentions don't allow exit when text is selected.

Steps to reproduce

  • Navigate to the showcase.
  • Add the text @abc
  • Hold down the Shift
  • Navigate backward with the arrow key to the @ symbol.

Expected results

You should be able to select the @ symbol.

Actual results

The selection jumps to the end when of the c key at the point the selection touches the @ symbol.

Possible Solution

Preserve selection currently doesn't work for non-empty selection.

Perhaps, rather than using from and to the implementation should use the head and anchor to ensure that exiting the mention preserves the intended selection.

Something like this should be added to the preserveSelection in @remirror/core-utils.

  • If the selection is empty, keep the current implementation
  • Otherwise, map the original head (the movable part of the selection) and anchor (the fixed part of the selection) over the current transaction steps.
  • Create a new text selection from: min(head, anchor, to: max(head, anchor) and apply it to the transaction.

Screenshot

2020-09-04 12 04 56

@ifiokjr ifiokjr added the type: bug 🪲 Something isn't working label Sep 4, 2020
@ifiokjr ifiokjr added this to To do in remirror@1.0.0 via automation Sep 4, 2020
@ifiokjr ifiokjr added this to Future in Internal Roadmap via automation Sep 4, 2020
@ifiokjr ifiokjr added this to Needs triage in Bugs via automation Sep 4, 2020
@ifiokjr ifiokjr added good first issue Good for newcomers package: remirror 🟣 Label for the remirror package and all relevant scoped `@remirror/*` packages. priority: high 🔼 This should be prioritised and completed soon. status: confirmed 🟢 The bug has been tested and confirmed. labels Sep 4, 2020
@ifiokjr ifiokjr moved this from Needs triage to High priority in Bugs Sep 4, 2020
@ifiokjr ifiokjr moved this from Future to September: 2020-09-06 (Week) in Internal Roadmap Sep 4, 2020
@ifiokjr ifiokjr moved this from September: 2020-09-06 (Week) to Ready in Internal Roadmap Sep 6, 2020
@ifiokjr ifiokjr moved this from To do to In progress in remirror@1.0.0 Sep 6, 2020
@ifiokjr ifiokjr self-assigned this Sep 6, 2020
@ifiokjr ifiokjr added this to the `prosemirror-suggest` milestone Sep 6, 2020
ifiokjr added a commit that referenced this issue Sep 6, 2020
@ifiokjr ifiokjr moved this from In progress to Ready in remirror@1.0.0 Sep 6, 2020
remirror@1.0.0 automation moved this from Ready to Done Sep 6, 2020
Bugs automation moved this from High priority to Closed Sep 6, 2020
Internal Roadmap automation moved this from Ready to Released Sep 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers package: remirror 🟣 Label for the remirror package and all relevant scoped `@remirror/*` packages. priority: high 🔼 This should be prioritised and completed soon. status: confirmed 🟢 The bug has been tested and confirmed. type: bug 🪲 Something isn't working
Projects
Bugs
  
Closed
Internal Roadmap
  
Released
Development

Successfully merging a pull request may close this issue.

1 participant