Skip to content

Commit 96b48c8

Browse files
committed
[Feat]: Add tabindex for the checkbox
1 parent d62967b commit 96b48c8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

client/packages/lowcoder/src/comps/comps/selectInputComp/checkboxComp.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { default as AntdCheckboxGroup } from "antd/es/checkbox/Group";
22
import { SelectInputOptionControl } from "comps/controls/optionsControl";
3-
import { BoolCodeControl } from "../../controls/codeControl";
3+
import { BoolCodeControl, NumberControl } from "../../controls/codeControl";
44
import { arrayStringExposingStateControl } from "../../controls/codeStateControl";
55
import { LabelControl } from "../../controls/labelControl";
66
import { ChangeEventHandlerControl } from "../../controls/eventHandlerControl";
@@ -115,6 +115,7 @@ export const getStyle = (style: CheckboxStyleType) => {
115115
const CheckboxGroup = styled(AntdCheckboxGroup) <{
116116
$style: CheckboxStyleType;
117117
$layout: ValueFromOption<typeof RadioLayoutOptions>;
118+
tabIndex?: number;
118119
}>`
119120
min-height: 32px;
120121
${(props) => props.$style && getStyle(props.$style)}
@@ -156,6 +157,7 @@ let CheckboxBasicComp = (function () {
156157
viewRef: RefControl<HTMLDivElement>,
157158
inputFieldStyle: styleControl(CheckboxStyle , 'inputFieldStyle'),
158159
animationStyle: styleControl(AnimationStyle , 'animationStyle'),
160+
tabIndex: NumberControl,
159161
...SelectInputValidationChildren,
160162
...formDataChildren,
161163
};
@@ -184,6 +186,7 @@ let CheckboxBasicComp = (function () {
184186
value: option.value,
185187
disabled: option.disabled,
186188
}))}
189+
tabIndex={typeof props.tabIndex === 'number' ? props.tabIndex : undefined}
187190
onChange={(values) => {
188191
handleChange(values as string[]);
189192
}}

0 commit comments

Comments
 (0)