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
Closed

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

wants to merge 3 commits into from

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
@@ -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)){
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.

None yet

2 participants