-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try consistency of tooltips text #4832
Conversation
It's need run "npm run build" to build the files.
Could we just use Lodash's |
Yes, sure, we can use this function. |
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.
Personally, I'd favor a solution which didn't incur a runtime transform on the text, but rather which could be guarded at a code level via an ESLint rule or equivalent.
That said, this seems like a reasonable interim solution, and I don't expect that there's much of a performance impact 👍
@@ -178,7 +178,7 @@ class Tooltip extends Component { | |||
className="components-tooltip" | |||
aria-hidden="true" | |||
> | |||
{ text } | |||
{ upperFirst( toLower( text ) ) } |
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.
couldn't this clash with different languages requirements?
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 did some tests with different languages like greek, chinese, korean, russian, persian and hindi. I did not found issues. But it was a quick test. Probably it's necessary investigate more.
Maybe it's better to try via an ESlint rule or equivalent as aduth said.
Yep, maybe I'm a bit old-school but I'm not sure I fully understand why this should be solved via code. To me, it's more a language specific issue and maybe good documentation and ESLint are a reasonable approach. |
Description
Some tooltips have title-cased text, some not. @afercia talked about it in issue #4325. So I've tried make all tooltips text with first character uppercase and the others characters lowercase. So I changed tooltip component for that.
I also changed the test because with "Help Text" the tooltip text must be "Help text".
How Has This Been Tested?
This has been tested with "npm test", "npm run test-e2e" and manually on Chrome and Firefox.
Types of changes
Bug fix
Checklist: