File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
src/libs/ui/lib/components/form/form-groups/form-input Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 22 ChangeEvent ,
33 Dispatch ,
44 FC ,
5+ FocusEvent ,
56 MouseEvent ,
67 MutableRefObject ,
78 ReactNode ,
@@ -83,13 +84,19 @@ const InputSelect: FC<InputSelectProps> = (props: InputSelectProps) => {
8384 className = { styles [ 'select-input-wrapper' ] }
8485 hideInlineErrors = { props . hideInlineErrors }
8586 ref = { triggerRef }
87+ forceFocusStyle = { menuIsVisible }
8688 >
8789 < button
8890 tabIndex = { props . tabIndex }
8991 className = { styles . selected }
9092 onClick = { toggleIfNotDisabled }
9193 type = 'button'
9294 disabled = { ! ! props . disabled }
95+ onFocus = { function onFocus ( event : FocusEvent < HTMLButtonElement > | undefined ) {
96+ event ?. stopPropagation ( )
97+ event ?. preventDefault ( )
98+ setMenuIsVisible ( true )
99+ } }
93100 >
94101 < span className = 'body-small' > { selectedOption ? label ( selectedOption ) : '' } </ span >
95102 < span className = 'body-small' > { ! selectedOption && ! ! props . placeholder ? props . placeholder : '' } </ span >
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ interface InputWrapperProps {
2525 readonly label : string | JSX . Element
2626 readonly tabIndex ?: number
2727 readonly type : 'checkbox' | 'password' | 'rating' | 'text' | 'textarea'
28+ readonly forceFocusStyle ?: boolean
2829}
2930
3031const InputWrapper : ForwardRefExoticComponent < InputWrapperProps & { ref ?: React . Ref < HTMLDivElement > } >
@@ -43,6 +44,9 @@ const InputWrapper: ForwardRefExoticComponent<InputWrapperProps & { ref?: React.
4344 focusStyle ,
4445 showError ? styles [ 'input-error' ] : undefined ,
4546 props . className ,
47+ {
48+ [ styles . focus ] : props . forceFocusStyle ,
49+ } ,
4650 )
4751
4852 const renderCheckboxLabel : ( ) => JSX . Element | boolean = ( ) => props . type === 'checkbox' && (
You can’t perform that action at this time.
0 commit comments