File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
packages/components/src/components/Input Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @devup-ui/components ' : patch
3+ ---
4+
5+ Fix input hadnClear
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export function Input({
5050 disabled,
5151 className,
5252 classNames,
53+ readOnly,
5354 ref,
5455 onClear,
5556 ...props
@@ -63,12 +64,16 @@ export function Input({
6364
6465 const handleClear = ( ) => {
6566 setValue ( '' )
67+ onChangeProp ?.( {
68+ target : { value : '' } ,
69+ } as React . ChangeEvent < HTMLInputElement > )
6670 onClear ?.( )
6771 }
6872
6973 const innerValue = valueProp ?? value
7074
71- const clearButtonVisible = ! ! innerValue && ! disabled && allowClear
75+ const clearButtonVisible =
76+ ! ! innerValue && ! disabled && allowClear && ! readOnly
7277
7378 return (
7479 < Box
You can’t perform that action at this time.
0 commit comments