You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f749fb7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+18-1Lines changed: 18 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ Then open `http://localhost:8000`.
66
66
67
67
| Property | Type | Default | Description |
68
68
| --- | --- | --- | --- |
69
-
| allowClear |`boolean \| { clearIcon?: ReactNode; disabled?: boolean; label?: string }`|`false`| Show a clear button, optionally with a custom icon, disabled state, or accessible label. |
69
+
| allowClear |`boolean \| AllowClearConfig`|`false`| Show a clear button, optionally with a custom icon, disabled state, or accessible label. |
70
70
| autoFocus |`boolean`|`false`| Focus the input when mounted. |
71
71
| changeOnBlur |`boolean`|`true`| Commit value changes on blur. |
72
72
| changeOnWheel |`boolean`|`false`| Allow value changes from the mouse wheel. |
@@ -151,3 +151,20 @@ The release flow is handled by `@rc-component/np` through the `rc-np` command af
151
151
## License
152
152
153
153
@rc-component/input-number is released under the [MIT](./LICENSE) license.
154
+
155
+
### Clear configuration
156
+
157
+
`allowClear` accepts a boolean or an `AllowClearConfig` object from `@rc-component/util`:
158
+
159
+
```ts
160
+
interfaceAllowClearConfig {
161
+
clearIcon?:React.ReactNode;
162
+
disabled?:boolean;
163
+
tabIndex?:number;
164
+
label?:string;
165
+
}
166
+
```
167
+
168
+
All fields are optional. `disabled: true` behaves like `allowClear={false}`: the clear button and space reserved solely for it are removed; the input remains editable. Existing suffixes and other content are preserved. This changes the previous hidden-button spacing behavior where applicable.
169
+
170
+
`tabIndex` affects only the clear button; `-1` removes it from Tab navigation while retaining mouse activation. `label` supplies its accessible name through `aria-label`. Defaults, clear values, callbacks, and component state restrictions are unchanged.
0 commit comments