Skip to content

Conversation

oleksandr-danylchenko
Copy link
Contributor

@oleksandr-danylchenko oleksandr-danylchenko commented Sep 8, 2025

Issue

In the #208 (comment) @rsimon and I discussed that it would be worth extending the dismissOnClickOutside into a more elaborate expression-like option.

Changes Made

Replaced the dismissOnClickOutside option with the dismissOnNotAnnotatable that now is the aforementioned expression. Now the dismissOnNotAnnotatable: ALWAYS option matches the previous dismissOnClickOutside: true.

(Soomo Staged, 09.09.25)

* Determines whether an active selection should be dismissed
* when a user ends their interaction (click, selection)
* on a non-annotatable element.
* - NEVER - don't dismiss the selection, ignore the action.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NEVER matches the behavior we had before the introduction of the dismissOnClickOutside.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not married to the ANNOTATABLE_AREAS name (and it's clunky I admit). But clicking outside of a highlight–but inside the annotatable area–does discard the current selection, so I wonder if NEVER works as a expected as a name? At the same time, with the necessary clarification in the docs, it might be the catchier/less convoluted term...

Copy link
Contributor Author

@oleksandr-danylchenko oleksandr-danylchenko Sep 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The important detail is that the dismissOnNotAnnotatable expression is relevant only when a user ends their interaction on a not-annotatable element.
With that in mind, reading the dismissOnNotAnnotatable="ANNOTATABLE_AREAS" looks a bit questionable. Like how the not-annotatable controls is impacted by the annotatable area 🤔
That's why I went with the dismissOnNotAnnotatable="NEVER". It clearly states that if an interaction ends on the not-annotatable, the dismissal should be cancelled.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point! I missed the renaming of the prop. I somehow was still thinking about the idea of naming it dismissOnPointerUp.

@oleksandr-danylchenko
Copy link
Contributor Author

The good news is that the migration to the dismissOnNotAnnotatable went pretty well in my app and it passed the QC ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants