-
Notifications
You must be signed in to change notification settings - Fork 106
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
[#173778636] UI accessibility rework #2059
Conversation
Affected stories
Generated by 🚫 dangerJS |
* | ||
* @param height | ||
*/ | ||
const calculateSlop = (height: number): number => { |
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.
Since this function may be reused on other components what do you think of isolating it in a util such as utils/ui.ts
?
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.
My idea was to remove all the code inside this file as soon as will be a refactoring of the basic components.
Perhaps it would be better to leave it there to facilitate its removal and if it should serve elsewhere, move it to a utility file. What you think?
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.
My idea was to remove all the code inside this file as soon as will be a refactoring of the basic components.
Perhaps it would be better to leave it there to facilitate its removal and if it should serve elsewhere, move it to a utility file. What you think?
I'm agree.
Until we don't refactor these partes it's convenient to add code in a focused otherwise it will be more difficult to remove/refactor if it is spread around the project
* | ||
* @param height | ||
*/ | ||
const calculateSlop = (height: number): number => { |
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.
To avoid compute slop on each button spawn, could we compute that values only a time?
const smallSlop = calculateSlop(customVariables.btnSmallHeight);
const xsmallSlop = calculateSlop(customVariables.btnXSmallHeight);
const dafaultSlop = calculateSlop(customVariables.btnHeight);
/**
* This is a temporary solution to extend the touchable area using the existing theme system.
* @deprecated
* @param props
*/
const getSlopForCurrentButton = (props: Props) => {
if (props.small) {
return smallSlop;
} else if (props.xsmall) {
return xsmallSlop;
}
return dafaultSlop;
};
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.
yep, definitely better :D changed in 640746a
Short description:
This pr introduces some accessibility rework.
List of changes proposed in this pull request:
How to test:
Describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.