Modal dialog box closing question

problem description

when you empty the input box, and then click the cancel button of the Modal dialog box, the non-empty check will be triggered directly, and the cancel method will not be triggered in time, resulting in the need to click repeatedly to close the pop-up box. It should be prompted to squeeze the button, causing the button to move down. If you put it below the button, you can directly close the pop-up box

by clicking cancel.

what I expect is to close directly by clicking cancel instead of checking. The feasible way now is how to keep the button position from moving

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Jan.21,2022

feels like your code problem. I tried it. No problem. You can use solt= "footer" to customize the bottom two buttons
Preview: https://jsfiddle.net/pbfh4cy0/

.
Menu