Skip to content

Commit

Permalink
feat(input,input-text,text-area): support spellcheck property (#10489)
Browse files Browse the repository at this point in the history
**Related Issue:** #9148 

## Summary

Adds support for `spellcheck` property.

`spellcheck` property is a global attribute. Please refer the spec
[here](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/spellcheck)
  • Loading branch information
anveshmekala authored Oct 10, 2024
1 parent 8753b92 commit 755bb4c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export class InputText
@Watch("autofocus")
@Watch("enterkeyhint")
@Watch("inputmode")
@Watch("spellcheck")
handleGlobalAttributesChanged(): void {
forceUpdate(this);
}
Expand Down Expand Up @@ -664,6 +665,7 @@ export class InputText
readOnly={this.readOnly}
ref={this.setChildElRef}
required={this.required ? true : null}
spellcheck={this.el.spellcheck}
tabIndex={this.disabled || (this.inlineEditableEl && !this.editingEnabled) ? -1 : null}
type="text"
value={this.value}
Expand Down
2 changes: 2 additions & 0 deletions packages/calcite-components/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export class Input
@Watch("autofocus")
@Watch("enterkeyhint")
@Watch("inputmode")
@Watch("spellcheck")
handleGlobalAttributesChanged(): void {
forceUpdate(this);
}
Expand Down Expand Up @@ -1209,6 +1210,7 @@ export class Input
readOnly={this.readOnly}
ref={this.setChildElRef}
required={this.required ? true : null}
spellcheck={this.el.spellcheck}
step={this.step}
tabIndex={
this.disabled || (this.inlineEditableEl && !this.editingEnabled) ? -1 : null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export class TextArea
//--------------------------------------------------------------------------

@Watch("autofocus")
@Watch("spellcheck")
handleGlobalAttributesChanged(): void {
forceUpdate(this);
}
Expand Down Expand Up @@ -329,6 +330,7 @@ export class TextArea
ref={this.setTextAreaEl}
required={this.required}
rows={this.rows}
spellcheck={this.el.spellcheck}
value={this.value}
wrap={this.wrap}
/>
Expand Down

0 comments on commit 755bb4c

Please sign in to comment.