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.

How to hide OK or Cancel buttons on Modal?

See original GitHub issue

Hi, In the docs it says:

You can customize the size of the buttons, disable buttons, hide the Cancel button (i.e. OK Only), choose a variant (e.g. danger for a red OK button) using the ok-variant and cancel-variant props, and provide custom button content using the ok-title and cancel-title props, or using the named slots modal-ok and modal-cancel.

The “hide the Cancel button (i.e. OK Only)” part gave me hope that I won’t have to replace the footer slot with just one “Cancel” button and could just… put something in the ok-variant ??? Like ok-variant="hidden"? Not sure, there doesn’t seem to be anything on that page that says how to exactly hide one of the buttons. 🤷‍♂️

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:7
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

120reactions
sumrakxcommented, Jan 15, 2019

Add property in b-modal component. hide-footer="true"

50reactions
emanuelmutschlechnercommented, Apr 19, 2018

Currently there is no such option as cancel-only. But it is very easy to achieve this behavior by using the ok button as cancel button. See my example below

<b-btn v-b-modal.modal1 variant="primary">Launch demo modal</b-btn>

<b-modal id="modal1" title="Bootstrap-Vue" ok-only ok-variant="secondary" ok-title="Cancel">
      <p class="my-4">Hello from modal!</p>
</b-modal>
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to hide the OK and Cancel buttons of antd Modal? #3925
In my case I am using Modal.info which I pass in a function, to pass its properties I do it through objects. I...
Read more >
Removing OK and Cancel buttons from spModal - ServiceNow
I need to disable the OK and the Cancel buttons that appear in the spModal popup window. I think I have found the...
Read more >
How to hide the OK and Cancel buttons of antd Modal?-Reactjs
In order to hide the cancel button in Modal.confirm pass display as none to the cancelButtonProps. Please refer the below code.
Read more >
How do you remove the "Ok" button that pops up in your ...
The OK button appears because you are creating a modal window. If you don't want it, don't make the window modal. It's your...
Read more >
Modal - Ant Design
Modal dialogs. ... Asynchronously close a modal dialog when the OK button is pressed. For example, you can use this pattern when you...
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