开发者

button state inconsistency after alert() execution causes involuntary double submit

开发者 https://www.devze.com 2023-03-02 22:27 出处:网络
A dashcode\'s \"Lozenge\" button element remain \"pressed\" or clicked after an alert gets displayed inside the button\'s onclick handler. Then, if I click anywhere in the same page, the onclick event

A dashcode's "Lozenge" button element remain "pressed" or clicked after an alert gets displayed inside the button's onclick handler. Then, if I click anywhere in the same page, the onclick event gets fired again.

When I 开发者_如何学编程get the second (undesired) data submission, I also get the following js error: Parts/core/views/Page.js line 378: TypeError: Result of expression 'event.targetTouches[0]' [undefined] is not an object.

I tried to hide the button before the alert and show it after, with no change of behavior at all.

Any thoughts ? Suggestion ? Solutions ?

Thank you so much for your time.


I had the same problem on my web app. What it solved for me was to add following line to the onclick handler:

document.getElementById('YOUR_BUTTON').object._setPressed(false);

Hope it helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消