Skip to content

Conversation

@bckp
Copy link
Contributor

@bckp 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
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

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)){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

around () should be spaces

@dg dg closed this in 6318da7 Oct 25, 2016
@bckp bckp deleted the patch-1 branch October 26, 2016 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants