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

Fixed issue with button type=submit that contains html #137

Closed
wants to merge 3 commits into from

Conversation

@bckp
Copy link
Contributor

bckp commented Oct 25, 2016

If button have some HTML inside, like <i class="icon icon-send"></i> and user click on <i> instead of button, nette thinks there is no submittedBy button, that is not true, as <i> have parent button element, so we need to go thru DOM tree, to check if the button isnt parent of clicked element.

If button have some HTML inside, like <i class="icon icon-send"></i> and user click on I instead of button, nette thinks there is no submittedBy button, that is not true, as <i> have parent button element, so we need to go thru DOM tree, to check if the button isnt parent of clicked element.
@bckp

This comment has been minimized.

Copy link
Contributor Author

bckp commented Oct 25, 2016

There is probably cleaner solution, but this one should work.

@bckp bckp changed the title Fixed issue with button type=submit with html Fixed issue with button type=submit that contains html Oct 25, 2016
bckp added 2 commits Oct 25, 2016
@@ -679,6 +679,9 @@ Nette.initOnLoad = function() {

Nette.addEvent(document.body, 'click', function(e) {
var target = e.target || e.srcElement;
while(target.parentNode && !(target.type in {submit: 1, image: 1} || target.form)){

This comment has been minimized.

Copy link
@dg

dg Oct 25, 2016

Member

around () should be spaces

@dg dg closed this in 6318da7 Oct 25, 2016
@bckp bckp deleted the bckp:patch-1 branch Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.