Skip to content

Commit 807a3ad

Browse files
nalogiudicechrisdholt
authored andcommitted
fix: addresses data issues with input button in text action (#1728)
* fixes data issues with button in text action * fixes logic * fixes missing prop * removes unneeded code * updates prop description
1 parent d42339a commit 807a3ad

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

packages/fast-components-react-msft/app/utilities/additional-props.plugin.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ export default class MapChildrenPropToCallbackPassingClassName extends Plugin<
1313
const callbackArguments: any = {
1414
className,
1515
};
16-
callbackArguments.disabled =
17-
typeof disabled === "boolean" ? disabled : undefined;
18-
callbackArguments.appearance =
19-
typeof appearance === "string" ? appearance : undefined;
16+
17+
if (disabled) {
18+
callbackArguments.disabled = disabled;
19+
}
20+
21+
if (appearance) {
22+
callbackArguments.appearance = appearance;
23+
}
2024

2125
return React.createElement(
2226
childOption.component,

packages/fast-components-react-msft/src/text-action/examples.data.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const examples: ComponentFactoryExample<TextActionProps> = {
1818
button: {
1919
id: buttonSchema.id,
2020
props: {
21-
disabled: true,
2221
children: {
2322
id: svgSchema.id,
2423
props: {
@@ -40,7 +39,6 @@ const examples: ComponentFactoryExample<TextActionProps> = {
4039
button: {
4140
id: buttonSchema.id,
4241
props: {
43-
disabled: true,
4442
children: {
4543
id: svgSchema.id,
4644
props: {
@@ -60,7 +58,6 @@ const examples: ComponentFactoryExample<TextActionProps> = {
6058
button: {
6159
id: buttonSchema.id,
6260
props: {
63-
disabled: true,
6461
children: "Search",
6562
},
6663
} as any,
@@ -82,7 +79,6 @@ const examples: ComponentFactoryExample<TextActionProps> = {
8279
button: {
8380
id: buttonSchema.id,
8481
props: {
85-
disabled: true,
8682
children: {
8783
id: svgSchema.id,
8884
props: {
@@ -103,7 +99,6 @@ const examples: ComponentFactoryExample<TextActionProps> = {
10399
button: {
104100
id: buttonSchema.id,
105101
props: {
106-
disabled: true,
107102
children: {
108103
id: svgSchema.id,
109104
props: {
@@ -146,7 +141,6 @@ const examples: ComponentFactoryExample<TextActionProps> = {
146141
button: {
147142
id: buttonSchema.id,
148143
props: {
149-
disabled: true,
150144
children: {
151145
id: svgSchema.id,
152146
props: {
@@ -169,7 +163,6 @@ const examples: ComponentFactoryExample<TextActionProps> = {
169163
button: {
170164
id: buttonSchema.id,
171165
props: {
172-
disabled: true,
173166
children: {
174167
id: svgSchema.id,
175168
props: {

packages/fast-components-react-msft/src/text-action/text-action.props.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ export interface TextActionHandledProps
2424
/**
2525
* The text action button
2626
*/
27-
button?: (
28-
classname?: string,
29-
disabled?: boolean,
30-
appearance?: ButtonAppearance
31-
) => React.ReactNode;
27+
button?: (classname?: string, disabled?: boolean) => React.ReactNode;
3228

3329
/**
3430
* Text action button position
@@ -56,6 +52,11 @@ export interface TextActionHandledProps
5652
* Callback for when text action input is blurred
5753
*/
5854
onBlur?: (e?: React.FocusEvent<HTMLInputElement>) => void;
55+
56+
/**
57+
* Overall disabled attribute that controls both the input and button disabled states
58+
*/
59+
disabled?: boolean;
5960
}
6061

6162
export type TextActionProps = TextActionHandledProps & TextActionUnhandledProps;

packages/fast-components-styles-msft/src/text-action/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ const styles: ComponentStyles<TextActionClassNameContract, DesignSystem> = (
107107
},
108108
},
109109
textAction_button: {
110-
borderColor: "transparent",
111-
color: neutralForegroundRest,
112-
fill: neutralForegroundRest,
113110
height: `calc(${height()(designSystem)} - 6px)`,
114111
minWidth: "fit-content",
115112
margin: "2px",

0 commit comments

Comments
 (0)