-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: simplify reflected attribute accesses #10356
base: dev
Are you sure you want to change the base?
Conversation
@@ -764,10 +761,6 @@ export class Dialog | |||
} | |||
} | |||
|
|||
private setContainerEl = (el: HTMLDivElement): void => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never read, thus removed
@@ -774,9 +774,9 @@ export class InputDatePicker | |||
|
|||
@State() private localeData: DateLocaleData; | |||
|
|||
private startInput: HTMLCalciteInputElement; | |||
private startInput: HTMLCalciteInputTextElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing a type error in Lumina - the ref is assigned to calcite-input-text, but the type here was calcite-input.
packages/calcite-components/src/components/input-number/input-number.tsx
Outdated
Show resolved
Hide resolved
@@ -146,8 +146,6 @@ export class Tooltip implements FloatingUIComponent, OpenCloseComponent { | |||
|
|||
guid = `calcite-tooltip-${guid()}`; | |||
|
|||
hasLoaded = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never read
@@ -228,7 +228,7 @@ export class CalciteMenu implements LocalizedComponent, T9nComponent, LoadableCo | |||
} | |||
|
|||
private getEffectiveRole(): string { | |||
return this.el.getAttribute("role") || "menubar"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
equivalent
Minor refactor - some HTML attributes are reflected to properties.
Thus, we can access properties instead of calling getAttribute/hasAttribute.
Properties are also more type-safe (where as getAttribute string parameter does not have type-checking)
And other minor changes.