Skip to content

Commit 5c6e202

Browse files
authored
Merge pull request #2396 from Akshat55/NumberInput
fix: Add 'data-invalid' attribute to apply appropriate styling to buttons when invalid
2 parents ca9be5a + 565cf40 commit 5c6e202

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/number-input/number.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export class NumberChange {
6666
[disabled]="disabled"
6767
[required]="required"
6868
[attr.aria-label]="ariaLabel"
69+
[attr.data-invalid]="invalid ? invalid : null"
6970
(input)="onNumberInputChange($event)"/>
7071
<svg
7172
*ngIf="!skeleton && !warn && invalid"

src/number-input/number.stories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ storiesOf("Components|Number", module).addDecorator(
4040
max: number("max", 100),
4141
step: number("step", 1),
4242
precision: number("precision"),
43-
invalid: boolean("Show form validation", false),
43+
invalid: boolean("Show form validation (invalid)", false),
4444
disabled: boolean("disabled", false)
4545
}
4646
}))

0 commit comments

Comments
 (0)