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

Stop disabling the Cancel button when in loading state #1501

Closed
limonte opened this issue Mar 30, 2019 · 4 comments
Closed

Stop disabling the Cancel button when in loading state #1501

limonte opened this issue Mar 30, 2019 · 4 comments
Labels
needs: breaking change Solving this issue/merging this PR would cause a breaking change released

Comments

@limonte
Copy link
Member

limonte commented Mar 30, 2019

This is the follow-up from #1494 (comment)

Disabling the Cancel button automatically is too opinionated, devs can always do it (if needed) in the preConfirm function:

preConfirm: () => {
  Swal.getCancelButton().setAttribute('disabled', '')
  ...
}
@limonte limonte added the needs: breaking change Solving this issue/merging this PR would cause a breaking change label Mar 30, 2019
@limonte limonte closed this as completed in ba7782c Nov 4, 2019
limonte added a commit that referenced this issue Nov 4, 2019
BREAKING CHANGE: Stop disabling the Cancel button when in showLoading()

Closes #1501
limonte pushed a commit that referenced this issue Nov 4, 2019
# [9.0.0](v8.19.0...v9.0.0) (2019-11-04)

* BREAKING CHANGE: remove .swal2-arabic-question-mark, add iconHtml param ([f73dcba](f73dcba)), closes [#1672](#1672) [#1532](#1532)
* BREAKING CHANGE: rename 'type' param to 'icon' ([fcaabee](fcaabee))
* BREAKING CHANGE: Stop disabling the Cancel button when in showLoading() ([3668055](3668055)), closes [#1501](#1501)
* BREAKING CHANGE: remove setProgressSteps(), showProgressSteps(), hideProgressSteps() ([53d9106](53d9106)), closes [#1507](#1507) [#1673](#1673)
* BREAKING CHANGE: remove disableConfirmButton() and enableConfirmButton() ([8ebbcaf](8ebbcaf))
* BREAKING CHANGE: remove inputClass ([ee7e392](ee7e392))
* BREAKING CHANGE: remove imageClass ([2594115](2594115))
* BREAKING CHANGE: remove confirmButtonClass and cancelButtonClass ([5276cfd](5276cfd))
* BREAKING CHANGE: remove customContainerClass ([c04782c](c04782c))
* BREAKING CHANGE: remove .swal2-shown from .swal2-container, add 'backdrop' to showClass and hideClass ([c3cbb74](c3cbb74))
* BREAKING CHANGE: replace animation with showClass and hideClass params ([f2153cb](f2153cb)), closes [#1193](#1193) [#654](#654) [#650](#650) [#761](#761)

### Features

* **api:** add 'icon' to showClass and hideClass ([7c4b324](7c4b324))

### BREAKING CHANGES

* remove .swal2-arabic-question-mark, add iconHtml param
* rename 'type' param to 'icon'
* Stop disabling the Cancel button when in showLoading()
* remove setProgressSteps(), showProgressSteps(), hideProgressSteps()
* remove disableConfirmButton() and enableConfirmButton()
* remove inputClass
* remove imageClass
* remove confirmButtonClass and cancelButtonClass
* remove customContainerClass
* remove .swal2-shown from .swal2-container, add 'backdrop' to showClass and hideClass
* replace animation with showClass and hideClass params
@limonte
Copy link
Member Author

limonte commented Nov 4, 2019

🎉 This issue has been resolved in version 9.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@yasawibu
Copy link

tada This issue has been resolved in version 9.0.0 tada

The release is available on:

* [npm package (@latest dist-tag)](https://www.npmjs.com/package/sweetalert2)

* [GitHub release](https://github.com/sweetalert2/sweetalert2/releases/tag/v9.0.0)

Your semantic-release bot packagerocket

I use version 9.15.1 installed from npm and this issue still exist.

@iwasherefirst2
Copy link

iwasherefirst2 commented Jan 24, 2023

I use version 11.6.8 and still have the same issue.

I think default should be that the cancel button should be hidden.
image

Is there any option to do this?

 Swal.fire({
                        title: 'Are you sure?',
                        showCancelButton: true,
                        html: 'Are you sure you want to change email from ' + this.formData.old_email + ' to ' + this.formData.new_email + ' in all systems?',
                        icon: 'question',
                        confirmButtonText: 'YES PLEASE',
                        showLoaderOnConfirm: true,
                        preConfirm: () => {
                            Swal.getCancelButton.addAttribute('hidden');

does not exactly work.

@jsdeveloperr
Copy link

You should add it like this. -> Swal.getCancelButton().setAttribute('hidden', true)

matvejs16 pushed a commit to matvejs16/sweetalert2-fix that referenced this issue Mar 29, 2023
BREAKING CHANGE: Stop disabling the Cancel button when in showLoading()

Closes sweetalert2#1501
matvejs16 pushed a commit to matvejs16/sweetalert2-fix that referenced this issue Mar 29, 2023
# [9.0.0](sweetalert2/sweetalert2@v8.19.0...v9.0.0) (2019-11-04)

* BREAKING CHANGE: remove .swal2-arabic-question-mark, add iconHtml param ([5b562cc](sweetalert2@5b562cc)), closes [sweetalert2#1672](sweetalert2#1672) [sweetalert2#1532](sweetalert2#1532)
* BREAKING CHANGE: rename 'type' param to 'icon' ([1d08a4b](sweetalert2@1d08a4b))
* BREAKING CHANGE: Stop disabling the Cancel button when in showLoading() ([e83c6f7](sweetalert2@e83c6f7)), closes [sweetalert2#1501](sweetalert2#1501)
* BREAKING CHANGE: remove setProgressSteps(), showProgressSteps(), hideProgressSteps() ([1e5a504](sweetalert2@1e5a504)), closes [sweetalert2#1507](sweetalert2#1507) [sweetalert2#1673](sweetalert2#1673)
* BREAKING CHANGE: remove disableConfirmButton() and enableConfirmButton() ([ec7245c](sweetalert2@ec7245c))
* BREAKING CHANGE: remove inputClass ([63ad421](sweetalert2@63ad421))
* BREAKING CHANGE: remove imageClass ([1500656](sweetalert2@1500656))
* BREAKING CHANGE: remove confirmButtonClass and cancelButtonClass ([278492e](sweetalert2@278492e))
* BREAKING CHANGE: remove customContainerClass ([d847fbd](sweetalert2@d847fbd))
* BREAKING CHANGE: remove .swal2-shown from .swal2-container, add 'backdrop' to showClass and hideClass ([0759404](sweetalert2@0759404))
* BREAKING CHANGE: replace animation with showClass and hideClass params ([388d769](sweetalert2@388d769)), closes [sweetalert2#1193](sweetalert2#1193) [sweetalert2#654](sweetalert2#654) [sweetalert2#650](sweetalert2#650) [sweetalert2#761](sweetalert2#761)

### Features

* **api:** add 'icon' to showClass and hideClass ([a111a7c](sweetalert2@a111a7c))

### BREAKING CHANGES

* remove .swal2-arabic-question-mark, add iconHtml param
* rename 'type' param to 'icon'
* Stop disabling the Cancel button when in showLoading()
* remove setProgressSteps(), showProgressSteps(), hideProgressSteps()
* remove disableConfirmButton() and enableConfirmButton()
* remove inputClass
* remove imageClass
* remove confirmButtonClass and cancelButtonClass
* remove customContainerClass
* remove .swal2-shown from .swal2-container, add 'backdrop' to showClass and hideClass
* replace animation with showClass and hideClass params
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: breaking change Solving this issue/merging this PR would cause a breaking change released
Projects
None yet
Development

No branches or pull requests

4 participants