-
Notifications
You must be signed in to change notification settings - Fork 98
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
feat: improving a11y #1070
feat: improving a11y #1070
Conversation
Preview is ready. |
src/components/Dialog/i18n/ru.json
Outdated
@@ -0,0 +1,3 @@ | |||
{ | |||
"close": "Закрыть" |
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.
Maybe "Close dialog"?
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.
Makes sense
src/components/Link/Link.tsx
Outdated
@@ -75,6 +75,7 @@ export const Link = React.forwardRef<HTMLElement, LinkProps>(function Link( | |||
const relProp = target === '_blank' && !rel ? 'noopener noreferrer' : rel; | |||
|
|||
return ( | |||
// children is passed in commonProps |
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.
may be if we pass children
explicitly this will pass this lint rule?
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.
yes, you were right
@@ -56,11 +56,27 @@ $block: '.#{variables.$ns}persona'; | |||
} | |||
} | |||
|
|||
&_clickable { | |||
#{$block}__main { |
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.
Move it to element itself, to have all styles for element in single place
#{$block} {
// ...
&__main {
#{$block}_clickable & {
//
}
}
// ...
}
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.
it was not obvious, but seems useful, thank you
<div className={b('text')}>{children}</div> | ||
</div> | ||
{React.createElement( | ||
clickable ? 'button' : 'div', |
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.
const MainComponent = clickable ? 'button' : 'div';
<MainComponent/>
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.
ok
@@ -136,5 +155,19 @@ $block: '.#{variables.$ns}persona'; | |||
&:hover { | |||
color: var(--g-color-text-primary); | |||
} | |||
|
|||
.yc-icon { |
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.
add className to icon component
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
@@ -58,3 +58,4 @@ export {useOnFocusOutside} from './utils/useOnFocusOutside'; | |||
export * from './utils/interactions'; | |||
export * from './utils/xpath'; | |||
export {getLayersCount} from './utils/LayerManager'; | |||
export {getUniqId} from './utils/common'; |
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.
Exporting useUniqId
hook is not enough?
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.
No, as one may use class components
@@ -137,6 +137,7 @@ const DropdownMenu = <T,>({ | |||
|
|||
return ( | |||
<DropdownMenuContext.Provider value={contextValue}> | |||
{/*as this div has Button component as child, clicking on it one fires onClick of this div on bubbling*/} |
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 guess we should make breaking change in future and always add onClick
to toggle control
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.
if button has onClick handler also, it may lead to double-handling of click event. Should be accurate there
620280a
to
b46148c
Compare
b46148c
to
b0bd78a
Compare
b0bd78a
to
f63ee78
Compare
closes #685
closes #966