-
Notifications
You must be signed in to change notification settings - Fork 12
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
va-statment-of-truth: make event payloads easier to use #1147
Conversation
@@ -161,7 +167,7 @@ export class VaStatementOfTruth { | |||
value={inputValue} | |||
message-aria-describedby={inputMessageAriaDescribedby} | |||
required | |||
onInput={this.handleInputChange} | |||
onVaTextInputChange={this.handleInputChange} |
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.
I'm not sure that I totally understand why we need two "change" events for va-text-input
now: onInput
and onVaTextInputChange
. Can you help me understand why we couldn't continue to use the nativeonInput
here and avoid having to modify va-text-input?
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.
@jamigibbs - you're right! I refactored to avoid using a custom event.
/** | ||
* The event emitted when the input value of the va-text-input element changes. | ||
*/ | ||
@Event() vaTextInputChange: EventEmitter; |
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.
Follow on my previous comment, I'm curious if instead of a new custom event here in va-text-input, it could instead be in va-statement-of-truth so that we can keep using the native onInput
event?
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.
@jamigibbs - see above!
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.
Very clean! ✨
Chromatic
https://2783-va-statement-truth-bug--65a6e2ed2314f7b8f98609d8.chromatic.com
Description
This PR addresses a bug in which the events payloads for the
vaInputChange
andvaCheckBoxChange
were difficult or impossible to make use of in an event handler. Now the payloads are at the top level of the event objects.Closes 2783
QA Checklist
Screenshots
vaInputChange
event before:vaInputChange
event aftervaCheckBoxChange
event beforevaCheckboxChange
event afterAcceptance criteria
Definition of done