File tree Expand file tree Collapse file tree
packages/root-cms/ui/components/DocEditor/fields Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ ' @blinkk/root-cms ' : patch
3+ ---
4+
5+ fix: fix issue with textarea focus requiring 2 clicks
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import {FieldProps} from './FieldProps.js';
77export function StringField ( props : FieldProps ) {
88 const field = props . field as schema . StringField ;
99 const [ value , setValue ] = useState ( '' ) ;
10- const [ autosize , setAutosize ] = useState ( false ) ;
1110
1211 function onChange ( newValue : string ) {
1312 setValue ( newValue ) ;
@@ -29,18 +28,13 @@ export function StringField(props: FieldProps) {
2928 < Textarea
3029 size = "xs"
3130 radius = { 0 }
32- autosize = { autosize }
33- minRows = { 3 }
31+ autosize = { false }
32+ minRows = { 4 }
3433 maxRows = { field . maxRows || 12 }
3534 value = { value }
3635 onChange = { ( e : ChangeEvent < HTMLTextAreaElement > ) => {
3736 onChange ( e . currentTarget . value ) ;
3837 } }
39- onFocus = { ( ) => {
40- if ( ! autosize ) {
41- setAutosize ( true ) ;
42- }
43- } }
4438 />
4539 ) ;
4640 }
You can’t perform that action at this time.
0 commit comments