-
Notifications
You must be signed in to change notification settings - Fork 7
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
Annotation isn't dismissed clicking outside of the annotator container
⚠️
#133
Comments
container
⚠️
…ick' into staging # Conflicts: # packages/text-annotator/src/SelectionHandler.ts
…ssed-annotation-on-outside-click #133 Fixed missing annotation dismissal clicking outside of the annotator `container`
…ick' into staging # Conflicts: # packages/text-annotator/src/SelectionHandler.ts
…ick' into keyboard-event-selection # Conflicts: # packages/text-annotator/src/SelectionHandler.ts
…ick' into staging
…ick' into keyboard-event-selection
I've also been back and forth with this. I think we have different UI requirements here, and I can see valid use cases for both. (Which may mean we might need to make this a config option.) In our case we have a whole bunch of UI components around the annotatable area. Things like setting annotation filters, changing color coding etc. Most of the time, users would expect that nothing should change about the selection when interacting with those parts of the UI. I.e. in this case, clicks outside the annotatable area should simply be ignored completely. I guess we could use a CSS selector like |
Applying the
I also thought about this, but I concluded that we'll always have a fairly limited set of known controls that we can always cover with the |
The only issue that differs between your use-case and ours - the positioning of the controls. We have them all located within the annotator container in the form of the popup and side notes. That way - marking controls with |
Issue
When you have a selection within the annotatable container and click outside - the selected annotation won't be dismissed.
Instead, the
userSelect
method is called on it:Screen.Recording.2024-08-13.at.16.21.06.mov
That's because the
pointerDown
method is initialized only on thecontainer
, but thepointerUp
is initialized on the whole document. Therefore, thecurrentTarget
is still present when the latter is executed, and theevt.timeStamp - lastPointerDown.timeStamp
is always too large:text-annotator-js/packages/text-annotator/src/SelectionHandler.ts
Lines 151 to 157 in e6d3f33
The text was updated successfully, but these errors were encountered: