From 15701b301bf3ac9b0897820d8aac13146f800bd8 Mon Sep 17 00:00:00 2001 From: AtsushiM Date: Mon, 27 Jan 2025 13:35:52 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20SingleComboBox=E3=81=AEcaret=E3=81=AB?= =?UTF-8?q?=E5=AF=BE=E3=81=97=E3=81=A6role=3D"presentation"=E3=82=92?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=97=E3=80=81=E8=A3=85=E9=A3=BE=E7=9A=84?= =?UTF-8?q?=E3=81=AA=E8=A6=81=E7=B4=A0=E3=81=A7=E3=81=82=E3=82=8B=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=82=92=E4=BC=9D=E3=81=88=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/ComboBox/ListBoxItemButton.tsx | 2 +- .../components/ComboBox/SingleComboBox/SingleComboBox.tsx | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/smarthr-ui/src/components/ComboBox/ListBoxItemButton.tsx b/packages/smarthr-ui/src/components/ComboBox/ListBoxItemButton.tsx index d6da4d659c..da71c64d99 100644 --- a/packages/smarthr-ui/src/components/ComboBox/ListBoxItemButton.tsx +++ b/packages/smarthr-ui/src/components/ComboBox/ListBoxItemButton.tsx @@ -66,7 +66,7 @@ const ListBoxItemButton = ({ ) const commonAttrs = { - type: 'button', + type: 'button' as const, role: 'option', id: option.id, key: option.id, diff --git a/packages/smarthr-ui/src/components/ComboBox/SingleComboBox/SingleComboBox.tsx b/packages/smarthr-ui/src/components/ComboBox/SingleComboBox/SingleComboBox.tsx index 5304b4447d..b97b30b792 100644 --- a/packages/smarthr-ui/src/components/ComboBox/SingleComboBox/SingleComboBox.tsx +++ b/packages/smarthr-ui/src/components/ComboBox/SingleComboBox/SingleComboBox.tsx @@ -62,10 +62,11 @@ type Props = BaseProps & { * コンポーネントからフォーカスが外れた時に発火するコールバック関数 */ onBlur?: () => void + // HINT: useListBox内でnoResultText, loadingTextは実行される /** * コンポーネント内のテキストを変更する関数/ */ - decorators?: DecoratorsType + decorators?: DecoratorsType } type ElementProps = Omit, keyof Props> @@ -323,6 +324,7 @@ const ActualSingleComboBox = ( const handleKeyPress = useCallback( (e: React.KeyboardEvent) => { if (e.key === 'Enter') e.preventDefault() + onKeyPress?.(e) }, [onKeyPress], @@ -404,8 +406,8 @@ const ActualSingleComboBox = ( className={styles.clearButtonIcon} /> - {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions, smarthr/a11y-delegate-element-has-role-presentation */} - + {/* eslint-disable-next-line smarthr/a11y-delegate-element-has-role-presentation */} +