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

Tooltip/Popover inputs naming conventions #736

Closed
Quinn-L opened this issue Sep 14, 2016 · 1 comment
Closed

Tooltip/Popover inputs naming conventions #736

Quinn-L opened this issue Sep 14, 2016 · 1 comment

Comments

@Quinn-L
Copy link

Quinn-L commented Sep 14, 2016

I'm a little uncomfortable with the input names on these directives as they could potentially conflict with 3rd party libraries that may coincidentally have directives that have the same input names, or the native browser.

eg. Popover's title is used natively to represent native tooltips, so you will see the popover's title as the tooltip on the popover's host element.

This could be solved by prefixing ngb at the small risk of conflicting with other ngb directives, though the naming style differs from how the components specify their inputs.
ui-bootstrap prefixed the input with popup- or tooltip-, not sure how likely a user would use two popover/tooltip directives on a single element.

Unfortunately this would be a breaking change.
Any thoughts or opinions?

@pkozlowski-opensource
Copy link
Member

I think that the answer to this question is 2-fold.

To start with I think that the issue only applies to popovers as tooltips don't have the title property. And for popovers the issue can be easily worked around by doing <div ngbPopover="..." [title]="'Some title'">. Not perfect but gets the job done.

Then there is a more philosophical question - shell we prefix all properties? I believe that this topic is higly debated in the Angular team itself and in the doc team specifically so @Foxandxss might have more input here. I don't think that there was any consensus reached so far. In a nutshell we've got this trade-off: avoid potential collisions at the expense of more typing.

I'm going to open this issue open so we can improve demo and see what is the best way forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants