mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
fix(select): add missing data-invalid in select and add missing data attributes in docs (#3177)
* fix(select): add missing data-invalid attribute * chore(docs): add missing data attributes for select base
This commit is contained in:
parent
6df27c6e63
commit
a0d6a77efb
5
.changeset/lazy-comics-crash.md
Normal file
5
.changeset/lazy-comics-crash.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@nextui-org/select": patch
|
||||
---
|
||||
|
||||
Add missing `data-invalid` attribute (#3149)
|
||||
@ -285,6 +285,14 @@ the popover and listbox components.
|
||||
|
||||
- **data-filled**:
|
||||
Indicates if the select has a value, is focused, has start/end content or is open.
|
||||
- **data-has-value**:
|
||||
Indicates if the select has selected item(s).
|
||||
- **data-has-label**:
|
||||
Indicates if the select has a label. Based on `label` prop.
|
||||
- **data-has-helper**:
|
||||
Indicates if the select has helper text. Based on `errorMessage` or `description` prop.
|
||||
- **data-invalid**:
|
||||
Indicates if the select is invalid. Based on `isInvalid` prop.
|
||||
|
||||
`Select` has the following attributes on the `trigger` element:
|
||||
|
||||
|
||||
@ -377,6 +377,7 @@ export function useSelect<T extends object>(originalProps: UseSelectProps<T>) {
|
||||
"data-has-value": dataAttr(hasValue),
|
||||
"data-has-label": dataAttr(hasLabel),
|
||||
"data-has-helper": dataAttr(hasHelper),
|
||||
"data-invalid": dataAttr(isInvalid),
|
||||
className: slots.base({
|
||||
class: clsx(baseStyles, props.className),
|
||||
}),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user