-
Notifications
You must be signed in to change notification settings - Fork 44
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
DismissButton
, RadioCard::Group
, RichTooltip::Toggle
- Type safety fixes
#2401
Conversation
Glint doesn't seem to be smart enough to recognize composable helpers, so we split the logic to make it happy.
Requires fixing the `HdsFormFieldsetLayoutValues` enum
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -131,10 +132,10 @@ export default class HdsFormField extends Component<HdsFormFieldSignature> { | |||
|
|||
@action | |||
appendDescriptor(element: HTMLElement): void { | |||
registerAriaDescriptionElement(this, element); | |||
registerAriaDescriptionElement(this as AriaDescribedByComponent, element); |
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.
AriaDescribedByComponent
is a more generic component signature covering the Field and Fieldset components (both potentially having descriptors, such as HelperText and Error). Their signatures vary in a sense that @layout
has different values, so we're doing this casting here to ensure TypeScript that they are matching the more generic type. I couldn't find an alternative, but open to suggestions.
📌 Summary
As we converted all our components to TypeScript I did a thorough check and discovered a few instances where glint ignore was not removed:
DismissButton
: needed it to be removedRadioCard::Group
: removing it revealed a complexity where Field and Fieldset share thelayout
argument, but have different values for them (vertical/flag and vertical/horizontal, respectively)RichTooltip::Toggle
: removing it meant the logic needed small adjustments (open to alternatives/suggestions)👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.