Have something to say?

Tell us how we could make the product more useful to you.

Select: wrong secondary variant invalid background color when focused

Problem When Select.Root is rendered with variant="secondary" and the field is invalid (isInvalid), the trigger background renders with the primary (white/--color-field-focus) background instead of the expected secondary (grey/--default) background. Root Cause: CSS Specificity In @heroui/styles, the invalid state rule nested inside.select__trigger compiles to specificity 0,3,0: /* specificity 0,3,0 */ .select[data-invalid="true"] .select__trigger, .select[aria-invalid="true"] .select__trigger { background-color: var(--color-field-focus); /* primary/white */ } The secondary variant rule only has specificity 0,2,0: /* specificity 0,2,0 */ .select--secondary .select__trigger { background-color: var(--select-trigger-bg); /* --default = grey */ } Since 0,3,0 > 0,2,0, the invalid state always overrides the secondary background β€” the secondary invalid override is missing.

NicolaCastellani 2 days ago

πŸ›

Issues

Modal & Alert dialog bug in Chrome related to Dropdown stucking

I found a Chrome-only bug in HeroUI v3 where opening a Modal or AlertDialog directly from a Dropdown item can leave the dropdown popover stuck on screen and still interactive. I could reproduce it reliably in Chrome, but Firefox works fine. The bug happens when the dropdown is closed and the next overlay is opened in the same action. A simple reproduction looks like this: setModalOpen(true)}>Open modal ... In Chrome, the modal opens, but the dropdown overlay may stay mounted instead of cleaning up correctly. It looks like a z-index issue at first, but it seems to be an overlay lifecycle problem, because both overlays can remain in the DOM at the same time. In my case, using Popover instead of Dropdown for this type of action menu fixed it, and so did delaying the second overlay until the first one was fully closed. Also 150ms timeout before opening modal/alert dialog fixes this issue.

mrn0_user 2 months ago

πŸ›

Issues