Is it possible to trigger on focus of a descendant element? #325
Replies: 3 comments
-
You could use |
Beta Was this translation helpful? Give feedback.
-
I've found what's going on: Inside the
You can see there is a statement finally changing the value from Anyway, this change is happening in a async way so the parent component doesn't know when the popover is actually open. Possible solutions:
|
Beta Was this translation helpful? Give feedback.
-
Ha I forgot about this issue. I found some way to work around what I was doing (it may have been |
Beta Was this translation helpful? Give feedback.
-
I've got a custom date picker field that utilizes three separate inputs for day / month / year. I would like a popover containing a calendar to be able to show when any of these have focus.
As it seems right now the popover works only when the root element is focused (and is made focusable by adding
tabindex="0"
). I know that the focus event does not bubble and attempting to manually bubble the focus event withElement.dispatchEvent
sadly does not work.I tried manually controlling the popover with
trigger="manual"
+ an:open
binding however I need to prevent open from becoming false whenever clicking inside the popver or inside of one of the active fields. I can probably get this to work with some amount of effort but it would be nice if the library could help out in some manner to make implementing this behavior less manual.Any ideas?
Edit: I'm using v3 alpha as the new setup makes things a bit nicer. (Nice work!)
Beta Was this translation helpful? Give feedback.
All reactions