Skip to content

Commit 1746b64

Browse files
committed
[Feat]: Add tabindex to the input field
1 parent 3e96f79 commit 1746b64

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

client/packages/lowcoder/src/comps/comps/textInputComp/inputComp.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ import { hasIcon } from "comps/utils";
3232
import { InputRef } from "antd/es/input";
3333
import { RefControl } from "comps/controls/refControl";
3434
import { migrateOldData, withDefault } from "comps/generators/simpleGenerators";
35+
import { numberSimpleControl } from "comps/controls/numberSimpleControl";
36+
import { NumberControl } from "comps/controls/codeControl";
3537

3638
import React, { useContext, useEffect } from "react";
3739
import { EditorContext } from "comps/editorState";
@@ -55,8 +57,9 @@ const childrenMap = {
5557
labelStyle:styleControl(LabelStyle, 'labelStyle'),
5658
prefixIcon: IconControl,
5759
suffixIcon: IconControl,
58-
inputFieldStyle: styleControl(InputLikeStyle, 'inputFieldStyle') ,
60+
inputFieldStyle: styleControl(InputLikeStyle, 'inputFieldStyle'),
5961
animationStyle: styleControl(AnimationStyle, 'animationStyle'),
62+
tabIndex: NumberControl,
6063
};
6164

6265
let InputBasicComp = new UICompBuilder(childrenMap, (props) => {
@@ -72,6 +75,7 @@ let InputBasicComp = new UICompBuilder(childrenMap, (props) => {
7275
$style={props.inputFieldStyle}
7376
prefix={hasIcon(props.prefixIcon) && props.prefixIcon}
7477
suffix={hasIcon(props.suffixIcon) && props.suffixIcon}
78+
tabIndex={typeof props.tabIndex === 'number' ? props.tabIndex : undefined}
7579
/>
7680
),
7781
style: props.style,
@@ -99,6 +103,7 @@ let InputBasicComp = new UICompBuilder(childrenMap, (props) => {
99103
{children.prefixIcon.propertyView({ label: trans("button.prefixIcon") })}
100104
{children.suffixIcon.propertyView({ label: trans("button.suffixIcon") })}
101105
{children.showCount.propertyView({ label: trans("prop.showCount") })}
106+
{children.tabIndex.propertyView({ label: trans("prop.tabIndex") })}
102107
{allowClearPropertyView(children)}
103108
{readOnlyPropertyView(children)}
104109
</Section>

client/packages/lowcoder/src/comps/utils/propertyUtils.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const allowClearPropertyView = (children: {
4040
allowClear: InstanceType<typeof BoolControl>;
4141
}) => children.allowClear.propertyView({ label: trans("prop.showClear") });
4242

43+
4344
export const showSearchPropertyView = (children: {
4445
showSearch: InstanceType<typeof BoolControl>;
4546
}) => children.showSearch.propertyView({ label: trans("prop.showSearch") });

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export const en = {
176176
"width": "Width",
177177
"selectApp": "Select App",
178178
"showCount": "Show Count",
179+
"tabIndex": "Tab Index",
179180
"textType": "Text Type",
180181
"customRule": "Custom Rule",
181182
"customRuleTooltip": "Non-empty string indicates an error; empty or null means validation passed. Example: ",

0 commit comments

Comments
 (0)