question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modal Message Box Confirm HTML in Title

See original GitHub issue

Thanks for adding the new beta modal plugin!! From what I am reading in the Docs, it is supported to pass the titleHtml property as an option to the this.$bvModal.msgBoxConfirm() service. However, it does not seem to be working to pass HTML to the titleHtml property as an option.

Code Example

const title = '<span class="text-info">Warning, This Is An HTML Title</span>';
const message = 'Some message...;
const response = await this.$bvModal.msgBoxConfirm(message, {
          titleHtml: title,
          noFade: true,
        });

Expected behavior

Expected to see the title parsed as HTML with the span element and class. Actually seeing the HTML passed directly to the title, as seen in the attached screenshot.

image

Versions

Libraries:

  • BootstrapVue: 2.0.0-rc.22
  • Bootstrap: 4.3.1
  • Vue: 2.6.10

Environment:

  • Device: Mac
  • OS: Mojave 10.14.5
  • Browser: Chrome
  • Version: 75.0.3770.80

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tmorehousecommented, Jun 11, 2019

As an interim workaround you can pass an array of vNodes like so:

const title = this.$createElement(
  'span',
  { class: ['text-info'] },
  'Warning, This Is An HTML Title'
);
const message = 'Some message...;
const response = await this.$bvModal.msgBoxConfirm(message, {
  title: [title], // must pass as an array
  noFade: true,
});

The message can also be passed as an array of vNode(s).

1reaction
tmorehousecommented, Jun 11, 2019

Thanks for finding this… we should be able to get this fixed for the next rc release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing the default title of confirm() in JavaScript?
I would like to do something like this: confirm("This is the content of the message box", "Modified title");
Read more >
how to change "message from webpage" title in confirm pop ...
You can use styled Modal Dialog method to emulate them. Here is the DEMO code of the dialog: <!DOCTYPE html> <html> <head> <title>Your ......
Read more >
How to add Title to modal dialog message - Oracle Communities
I am using APEX 5.1.2. i am using apex.confirm() JavaScript API to show a modal dialog when user tries to deactivate something by...
Read more >
Window confirm() Method - W3Schools
The confirm() method displays a dialog box with a message, an OK button, and a Cancel button. The confirm() method returns true if...
Read more >
Window.confirm() - Web APIs - MDN Web Docs
Dialog boxes are modal windows — they prevent the user from accessing the rest of the program's interface until the dialog box is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found