From cd0d01f5e584cced3fa5c6ca4b3009e8bda578ef Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Tue, 25 Aug 2020 09:30:28 -0400 Subject: [PATCH] Add required prop to select --- src/components.d.ts | 8 ++++++++ src/components/select/select.tsx | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/components.d.ts b/src/components.d.ts index e468f1579..a0e1636b2 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -766,6 +766,10 @@ export namespace Components { * The select's placeholder text. */ "placeholder": string; + /** + * The select's required attribute. + */ + "required": boolean; /** * The select's size. */ @@ -2132,6 +2136,10 @@ declare namespace LocalJSX { * The select's placeholder text. */ "placeholder"?: string; + /** + * The select's required attribute. + */ + "required"?: boolean; /** * The select's size. */ diff --git a/src/components/select/select.tsx b/src/components/select/select.tsx index fd31689e1..e77591d55 100644 --- a/src/components/select/select.tsx +++ b/src/components/select/select.tsx @@ -74,6 +74,9 @@ export class Select { /** The select's label. */ @Prop() label = ''; + /** The select's required attribute. */ + @Prop() required: boolean; + /** Set to true to indicate that the user input is valid. */ @Prop() valid = false; @@ -350,6 +353,7 @@ export class Select { size={this.size} valid={this.valid} invalid={this.invalid} + required={this.required} aria-labelledby={this.labelId} aria-describedby={this.helpTextId} onSlFocus={this.handleFocus}