How to hide OK or Cancel buttons on Modal?
See original GitHub issueHi, 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:
- Created 5 years ago
- Reactions:7
- Comments:15 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Add property in
b-modal
component.hide-footer="true"
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