@@ -65,19 +65,14 @@ export const useInputProps = ({
6565 const inputInlineStyles = React . useRef < Record < string , any > > ( { } ) ;
6666 let prefixRef = React . useRef < HTMLElement > ( null ) ;
6767 let suffixRef = React . useRef < HTMLElement > ( null ) ;
68- prefixRef = useForkRef (
69- prefixRef ,
70- componentProps ?. prefixProps ?. ref ,
71- ) as unknown as React . RefObject < HTMLElement > ;
72- suffixRef = useForkRef (
73- suffixRef ,
74- componentProps ?. suffixProps ?. ref ,
75- ) as unknown as React . RefObject < HTMLElement > ;
68+
7669 useSafeLayoutEffect ( ( ) => {
7770 let key = "" ;
7871
7972 const prefixElement = prefixRef . current ;
73+ console . log ( "%cprefixElement" , "color: #007300" , prefixElement ) ;
8074 const suffixElement = suffixRef . current ;
75+ console . log ( "%csuffixElement" , "color: #006dcc" , suffixElement ) ;
8176 if ( uiProps . prefix && prefixElement ) {
8277 key = "paddingLeft" ;
8378
@@ -118,26 +113,34 @@ export const useInputProps = ({
118113 [ componentProps . baseProps , disabled , restProps , uiProps ] ,
119114 ) ;
120115
116+ const _prefixRef = useForkRef (
117+ prefixRef ,
118+ componentProps ?. prefixProps ?. ref ,
119+ ) as unknown as React . RefObject < HTMLElement > ;
121120 const prefixProps : InputPrefixProps = React . useMemo (
122121 ( ) => ( {
123122 ...uiProps ,
124123 disabled,
125124 ...componentProps . prefixProps ,
126- ref : prefixRef ,
125+ ref : _prefixRef ,
127126 children : withIconA11y ( uiProps . prefix , uiProps ) ,
128127 } ) ,
129- [ componentProps . prefixProps , disabled , uiProps ] ,
128+ [ _prefixRef , componentProps . prefixProps , disabled , uiProps ] ,
130129 ) ;
131130
131+ const _suffixRef = useForkRef (
132+ suffixRef ,
133+ componentProps ?. suffixProps ?. ref ,
134+ ) as unknown as React . RefObject < HTMLElement > ;
132135 const suffixProps : InputSuffixProps = React . useMemo (
133136 ( ) => ( {
134137 ...uiProps ,
135138 disabled,
136139 ...componentProps . suffixProps ,
137- ref : suffixRef ,
140+ ref : _suffixRef ,
138141 children : uiProps . suffix ,
139142 } ) ,
140- [ componentProps . suffixProps , disabled , uiProps ] ,
143+ [ componentProps . suffixProps , _suffixRef , disabled , uiProps ] ,
141144 ) ;
142145
143146 return {
0 commit comments