Skip to content

Commit

Permalink
refactor: use correct input-text type
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpatiiuk committed Sep 19, 2024
1 parent 7b44dd4 commit 2305e01
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1095,8 +1095,8 @@ export class InputNumber
autofocus={this.el.autofocus ? true : null}
defaultValue={this.defaultValue}
disabled={this.disabled ? true : null}
enterKeyHint={this.el.enterKeyHint}
inputMode={this.el.inputMode || "decimal"}
enterKeyHint={this.el.enterKeyHint || this.el.getAttribute("enterkeyhint")}
inputMode={this.el.inputMode || this.el.getAttribute("inputmode") || "decimal"}
key="localized-input"
maxLength={this.maxLength}
minLength={this.minLength}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,8 @@ export class InputText
}}
defaultValue={this.defaultValue}
disabled={this.disabled ? true : null}
enterKeyHint={this.el.enterKeyHint}
inputMode={this.el.inputMode}
enterKeyHint={this.el.enterKeyHint || this.el.getAttribute("enterkeyhint")}
inputMode={this.el.inputMode || this.el.getAttribute("inputmode")}
maxLength={this.maxLength}
minLength={this.minLength}
name={this.name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export class InputTimePicker

@Element() el: HTMLCalciteInputTimePickerElement;

@State() calciteInputEl: HTMLCalciteInputElement;
@State() calciteInputEl: HTMLCalciteInputTextElement;

defaultValue: InputTimePicker["value"];

Expand Down Expand Up @@ -853,7 +853,7 @@ export class InputTimePicker
this.openHandler();
};

private setInputEl = (el: HTMLCalciteInputElement): void => {
private setInputEl = (el: HTMLCalciteInputTextElement): void => {
this.calciteInputEl = el;
};

Expand Down
6 changes: 3 additions & 3 deletions packages/calcite-components/src/components/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1171,9 +1171,9 @@ export class Input
const prefixText = <div class={CSS.prefix}>{this.prefixText}</div>;
const suffixText = <div class={CSS.suffix}>{this.suffixText}</div>;

const autofocus = this.el.autofocus ? true : null;
const enterKeyHint = this.el.enterKeyHint;
const inputMode = this.el.inputMode;
const autofocus = this.el.autofocus || this.el.hasAttribute("autofocus") ? true : null;
const enterKeyHint = this.el.enterKeyHint || this.el.getAttribute("enterkeyhint");
const inputMode = this.el.inputMode || this.el.getAttribute("inputmode");

const localeNumberInput =
this.type === "number" ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ export class Tooltip implements FloatingUIComponent, OpenCloseComponent {

guid = `calcite-tooltip-${guid()}`;

hasLoaded = false;

openTransitionProp = "opacity";

transitionEl: HTMLDivElement;
Expand Down Expand Up @@ -175,7 +173,6 @@ export class Tooltip implements FloatingUIComponent, OpenCloseComponent {
if (this.referenceElement && !this.effectiveReferenceElement) {
this.setUpReferenceElement();
}
this.hasLoaded = true;
}

disconnectedCallback(): void {
Expand Down

0 comments on commit 2305e01

Please sign in to comment.