Skip to content

Not possible to change title for popover. #16731

@Envek

Description

@Envek

Hello!

I have next code:

<a href="/foo/like" title="4 users liked this" data-requires-captcha="true">
  <span class="glyphicon glyphicon-thumbs-up"></span>
  Like!
  <span class="badge">4</span>
</a>
// In event handler
if ($(this).data().requiresCaptcha) {
  $(this).popover({title: 'Please confirm that you are human', placement: 'auto bottom'});
  return false;
} 

And when user clicks button with data-requires-captcha attribute set to true (I set it up for anonymous users), I intercept click, construct popover, and placing ReCaptcha into the popover body. But text from title attribute (obviously used for browsers' native link popover and I need it) is going to the Bootstrap popover title, and I see no way to replace it with my own (title specified in popover method call is ignored, as written in docs).

My thoughts:

  • Popover should not use standard title attribute, it should use something like data-title instead (with fallback to title if not present).
  • Popover should have some method to change title dynamically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions