Skip to content
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

EZP-31236: Added bootstrap tooltip for all nodes with attribute title #246

Conversation

lucasOsti
Copy link
Contributor

@lucasOsti lucasOsti commented Jan 10, 2020

title: label,
tabIndex: '-1',
onClick: handleClick,
};

attrs.className = disabled ? `${attrs.className} ${baseClassName}--disabled` : attrs.className;
attrs.className = type ? `${attrs.className} ${baseClassName}--${type}` : attrs.className;
attrs.disabled = disabled ? 'disabled' : false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think:
attrs.disabled = disabled should be okej

@lucasOsti lucasOsti requested a review from GrabowskiM February 6, 2020 11:38
@lucasOsti lucasOsti force-pushed the EZP-31236-added-tooltips-as-new-ui-component branch from fde4129 to 4db3dfb Compare February 7, 2020 13:21
@@ -244,6 +244,7 @@ export default class SubItemsModule extends Component {
*/
switchView(activeView) {
this.setState(() => ({ activeView }));
eZ.helpers.tooltips.hideAll();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do it in the setState callback as change state can be postponed in react

@@ -247,7 +243,7 @@ export default class SubItemsModule extends Component {
* @memberof SubItemsModule
*/
switchView(activeView) {
this.setState(() => ({ activeView }));
this.setState(() => ({ activeView }), eZ.helpers.tooltips.hideAll());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The second parameter in setState is a function. I don't know how this will work.

Suggested change
this.setState(() => ({ activeView }), eZ.helpers.tooltips.hideAll());
this.setState(() => ({ activeView }), () => eZ.helpers.tooltips.hideAll());

@lucasOsti lucasOsti requested a review from dew326 February 20, 2020 15:50
@lucasOsti lucasOsti force-pushed the EZP-31236-added-tooltips-as-new-ui-component branch from d35191c to 593dd39 Compare February 24, 2020 10:01
@lserwatka lserwatka merged commit 3ef29b1 into ezsystems:master Feb 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

6 participants