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

popover html replace title and content #12754

Closed
acornejo opened this issue Feb 16, 2014 · 6 comments
Closed

popover html replace title and content #12754

acornejo opened this issue Feb 16, 2014 · 6 comments

Comments

@acornejo
Copy link

(This is not a bug report, but a feature request)

Currently bs3 provides options for setting the title and the content of the popovers, together with an html boolean to determine if the content and title should be escaped as text, or inserted as html.

I propose to allow html to be a domnode or a string. If that is the case, the content and title options are ignored, and the domnode or string are used to populate the interior of the popover.

I think this feature would be immensely useful and simplify a lot of use-cases, since a lot of people out there have worked out all sorts of hacks to customize the contents of popovers (for instance, things like placing a close button on the title of the popover has been subject to numerous stack overflow questions and blog posts).

PS: I can create a pull-request implementing this feature, but I don't want to waste the time if this won't be included in bootstrap.

@cvrebert cvrebert added this to the v3.2.0 milestone Feb 16, 2014
@saas786
Copy link
Contributor

saas786 commented Feb 16, 2014

Hi @acornejo, it will be good if you could list down popular stack overflow questions relating your feature request. If there is really a need for features then I am sure core team won't mind adding or creating it.

I personally would like tooltip / popover to be more advanced (in BS3) but its a matter of personal taste, as almost 70-80% (I personally think its 90+%) of bootstrap users don't use BS3 tooltip / popover for advanced usage, so adding extra features to it is not gonna be good idea, if it brings performance or such issues.
I personally had used

https://github.com/kswedberg/jquery-cluetip

this plugin it past, and trust me I really liked it, so maybe you want to have a look at it for you need(s). I have tried about dozens of tooltip plugins but settled with this one.

Regarding your pull-request, it won't be a waste of time even if it won't get into core, you could still utilize it for your personal projects :D.

@acornejo
Copy link
Author

Hi @saas786

These are the first two google matches for people asking how to add close buttons to popovers:

http://stackoverflow.com/questions/15606760/how-to-create-bootstrap-popover-close-option
http://stackoverflow.com/questions/13413057/how-to-insert-close-button-in-popover-for-bootstrap/13436113#13436113

The feature I proposed is backward compatible, and has no performance issues whatsoever.

Thanks for the pointer to jquery-cluetip, there are plenty of solutions to popovers out there. If you are looking for alternatives, I suggest you look at Semantic-UI for a complete alternative to bootstrap complete with popovers with customizable content (much like the proposed feature). I highly recommend it for new projects.

Per the pull-request, I already have a hacky version which I use for my projects (which doesn't require modifying bootstrap). Creating the pull-request would not take me more than 5 minutes, but in my experience the mantainers of projects as large as bootstrap sometimes won't accept pull-requests for new features without a discussion (which was the purpose of opening this issue).

@saas786
Copy link
Contributor

saas786 commented Feb 20, 2014

@acornejo I reviewed these two questions, and I don't think they are that much popular questions upon which we can make assumption that this is highly needed feature and must be part of core. You see in answers that is quick and dirty solution, which you can easily use in your code and most importantly via "Popover" Events.

And as bootstrap is Mobile first and also in modern web, there is not lot place for tooltips / popovers, you should only use them unless they are really really needed, also for mobile devices you have to provide fallbacks, and providing two versions for same feature makes your work more harder, so that's another no for popover uses.

So I am not sure if your feature is gonna be considered for core. As core team already have lot and important tasks / features to deal with.

And remember, adding any new feature, brings new bugs, new compatibility issues, performance issues, usability issues and long list of issues :).

So unless feature is really needed, and can be a part of core, its not gonna be considered.

@acornejo
Copy link
Author

@saas786 If after your review process you have decided my proposed fearure is not worth inclusion then feel free to mark this issue as wontfix and/or close it.

@cvrebert cvrebert modified the milestones: v3.3.0, v3.2.1 Jun 9, 2014
@cvrebert cvrebert added this to the v4.0.0 milestone Jul 8, 2014
@mizzao
Copy link

mizzao commented Jul 25, 2014

When using popovers as a way to display additional information, the use of string as content is very limiting. For example, Meteor renders a DOMFragment and updates it in real time as the data source changes. Other frameworks that support taking a DOMFragment directly work seamlessly, but with Bootstrap 3 popovers we must first render the popover with a static HTML string (so that it is positioned properly), then find the content node and re-render it with the dynamically updated content.

Having better support for this type of use case would greatly improve interoperability with reactive rendering frameworks and more dynamic content.

@mdo
Copy link
Member

mdo commented Aug 2, 2014

Punting to the v4 checklist.

@mdo mdo closed this as completed Aug 2, 2014
@mdo mdo removed this from the v4.0.0 milestone Aug 2, 2014
@mdo mdo mentioned this issue Aug 19, 2015
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

5 participants