openui / open-ui

Maintain an open standard for UI and promote its adherence and adoption.
https://open-ui.org
Other
3.59k stars 191 forks source link

[invokers - interest] What to do with manual popovers on lose interest #1037

Open brechtDR opened 7 months ago

brechtDR commented 7 months ago

https://github.com/openui/open-ui/issues/872 gave rise to the potential benefit of a loseinterest option again.

If we would have a manual popover that also gets triggered with interest. What happens when we lose focus? Does it close.

For the moment there isn't something to define this such as a loseinterestaction. Having a loseinterestaction might be too overloaded, but we should at least discuss the possibility, or how we would handle such use-cases.

lukewarlow commented 6 months ago

I wonder if rather than having a second attribute we can allow the attribute to be two space separated values? First for gain action second for lose action?

Idk if there's precedence for that sort of thing?

lukewarlow commented 6 months ago

Thinking on this some more I think a manual popover should behave just like a hint or auto wrt the interest behaviour. Just like invokers can open and close a manual popover, interest invokers should do the same.

The difference being that a manual popover doesn't close other popovers and doesn't have light dismiss.

brechtDR commented 6 months ago

The difference being that a manual popover doesn't close other popovers and doesn't have light dismiss.

Interesting point of view. I'm just wondering if "losing focus" should be considered a "light dismiss" in this story? Because in that case, it does have some sort of light dismiss behavior when manual and interest combined with losing focus. If that makes sense.... I might be overthinking it.

lukewarlow commented 6 months ago

I get what you mean. "spec" wise light dismiss is explicitly click outside, so they're missing a close watcher AND light dismiss. But invokers are effectively the same as the imperative JS APIs, which always work.

github-actions[bot] commented 1 week ago

There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.