-
Notifications
You must be signed in to change notification settings - Fork 351
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
[numeric-refactor-feedback-cleanup] Numeric Input Refector Feedback #2268
Conversation
Size Change: -78 B (-0.01%) Total Size: 872 kB
ℹ️ View Unchanged
|
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (f35dd10) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR2268 If you are working in Khan Academy's webapp, you can run: ./dev/tools/bump_perseus_version.sh -t PR2268 |
…d clean up text-input
…ements for Numeric Input after Refactor changes.
|
||
const getUniqueId = () => { | ||
return `input-with-examples-${id}`; | ||
}; |
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.
Does this need to be a function, now that it's simpler? Could we just have the following up around line 63:
const id = useId();
const ariaId = `aria-for-${id}`;
@@ -113,7 +113,7 @@ class TextInput extends React.Component<Props> { | |||
id={this.id} | |||
value={formattedValue} | |||
type="text" | |||
aria-label={labelText || undefined} | |||
aria-label={labelText} |
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 think the undefined
was there so that there is no aria-label
attribute when labelText
is blank. Otherwise, we end up with aria-label=""
.
…we don't want the empty string to get set. Also some test data cleanup
… then update tests and snapshots to match
Summary:
This is a little PR that addresses some additional feedback points from the Numeric Input Refactor.
This includes:
getTooltipContent
torenderTooltipContent
NumericExampleStrings
after they were moved into the util file.ariaLabel
setting toundefined
.Test plan: