File tree Expand file tree Collapse file tree 2 files changed +24
-21
lines changed
ui-text-input/src/TextInput Expand file tree Collapse file tree 2 files changed +24
-21
lines changed Original file line number Diff line number Diff line change @@ -279,25 +279,28 @@ type: example
279279### Handling overflow
280280
281281When ` direction ` is set to ` column ` , Flex.Items' ` overflowY ` property is automagically set
282- to ` auto ` to account for content overflow with a vertical scrollbar.
282+ to ` auto ` to account for content overflow with a vertical scrollbar. Add padding, so focus rings are not cut off.
283283
284284> To override this default, simply set ` overflowY ` on the Flex.Item to either ` visible ` or ` hidden ` .
285285
286286``` js
287287-- -
288288type: example
289289-- -
290- < Flex
291- withVisualDebug
292- direction= " column"
293- >
294- < Flex .Item padding= " small" >
295- < Heading> Pandas are cute, right? < / Heading>
296- < / Flex .Item >
297- < Flex .Item size= " 150px" padding= " small" >
298- < Img src= {avatarSquare} / >
299- < / Flex .Item >
300- < / Flex>
290+ < Flex
291+ withVisualDebug
292+ direction= " column"
293+ >
294+ < Flex .Item padding= " small" >
295+ < Heading> Pandas are cute, right? < / Heading>
296+ < / Flex .Item >
297+ < Flex .Item >
298+ < TextInput name= " name" renderLabel= " If you dont add padding, the focus ring will be cut off!" / >
299+ < / Flex .Item >
300+ < Flex .Item size= " 150px" padding= " small" >
301+ < Img src= {avatarSquare} / >
302+ < / Flex .Item >
303+ < / Flex>
301304` ` `
302305
303306### A few common layouts
Original file line number Diff line number Diff line change @@ -81,11 +81,11 @@ const generateStyle = (
8181 const focusedStyle = focused
8282 ? {
8383 opacity : 1 ,
84- transform : 'scale(1) '
84+ outlineOffset : '0.15rem '
8585 }
8686 : {
8787 opacity : 0 ,
88- transform : 'scale(0.95) '
88+ outlineOffset : '-0.9rem '
8989 }
9090
9191 const invalidStyle = invalid
@@ -176,13 +176,13 @@ const generateStyle = (
176176 position : 'absolute' ,
177177 display : 'block' ,
178178 boxSizing : 'border-box' ,
179- top : '-0.25rem ' ,
180- bottom : '-0.25rem ' ,
181- left : '-0.25rem ' ,
182- right : '-0.25rem ' ,
183- border : `${ componentTheme . focusOutlineWidth } ${ componentTheme . focusOutlineStyle } ${ componentTheme . focusOutlineColor } ` ,
184- borderRadius : `calc( ${ componentTheme . borderRadius } * 1.5)` ,
185- transition : 'all 0.2s' ,
179+ top : '0 ' ,
180+ bottom : '0 ' ,
181+ left : '0 ' ,
182+ right : '0 ' ,
183+ outline : `${ componentTheme . focusOutlineWidth } ${ componentTheme . focusOutlineStyle } ${ componentTheme . focusOutlineColor } ` ,
184+ borderRadius : componentTheme . borderRadius ,
185+ transition : 'opacity 0.2s, outline-offset 0.2s ease-out ' ,
186186
187187 ...focusedStyle , // properties to transition on :focus
188188 ...invalidAndFocusedStyle
You can’t perform that action at this time.
0 commit comments