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

feat(ui5-switch): provide tooltip property #5954

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

unazko
Copy link
Contributor

@unazko unazko commented Oct 19, 2022

  • Application developers are enabled to use the new tooltip property in cases when referring
    an external label is not wanted.

Fixes: #5552

- Application developers are enabled to use
the new tooltip property in cases when referecing
and external label is not wanted.

Fixes: SAP#5552
* @defaultvalue: ""
* @public
* @since 1.9.0
*/
Copy link
Member

Choose a reason for hiding this comment

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

In the case we need to provide API for setting the tooltip, we often provide a private property, called "title".
And because it's called "title" we operate with the value of the standard HTML "title" attribute. This is done in several components already: see Option, TreeItem, ListItem, SideNavigationItem

/**
* Defines the tooltip of the component.
* @type {string}
* @DefaultValue ""
* @Private
*/
title: {
type: String,
},

There is a "tooltip" in Button, can't recall the reason, but at least initially you can support the native way of setting a tooltip - with the "title" via the private "title" property. In case there is some specific things that requires a separate property, you can always do that.

<ui5-switch title="my cool tooltip"></ui5-switch>

Advantages

  • native way for setting tooltip
  • no public API
  • tooltip property can be always added later if required

Copy link
Member

@ilhan007 ilhan007 Oct 26, 2022

Choose a reason for hiding this comment

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

On second thought, there might be duplicate reading with Jaws... so yes it may not work for you (you can test it if not already). If that's the case "tooltip" is fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

Checked it with JAWS and it's read out twice if we use title. I think we have to stick to the tooltip solution

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I approve +1

@ilhan007 ilhan007 self-requested a review October 28, 2022 10:33
@tsanislavgatev tsanislavgatev merged commit 5b5db73 into SAP:main Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[SF_ACC][Switch] Switch needs tooltip support
3 participants