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

How can I find out why the confirm dialog does not appear sometimes #101

Open
sbillard opened this issue Mar 23, 2016 · 4 comments
Open
Labels

Comments

@sbillard
Copy link

I have a form with user and password fields on it. These are classed to be ignored so that browser auto filling them does not get in the way. The fields are hidden. The JS that shows the fields removes the dirty ignore class. I also have a "submit" button with CSS so that the button highlights if the form has the dirty class assigned.

If I do not toggle the user/password fields to be visible all works properly.

If I do toggle the fields visible and make a change to the form, the button highlights indicating the form is dirty but no dialog pops up if I attempt to leave the form. This happens with any element, not just the user/password.

Any helpful hints on this would be appreciated.

@NightOwl888
Copy link
Collaborator

I am not sure exactly what is happening here, but I can tell you that when the focus or keydown event of an element is fired and there is no original value stored (i.e. the element was added to the DOM dynamically), Dirty Forms will not respect the ignoreClass in this case. So under this scenario, if the value of the field is not the same as the value that is submitted, the dirty status will be true.

It sounds like there is a lot going on in your form. So it would be best if you could provide an HTML document that reproduces the problem, if possible.

@sbillard
Copy link
Author

Thanks for the info. The elements are indeed being added to the DOM, but the issue is that the Confirm leaving the page dialog does not pop up. So far as I can tell, the form has the dirty class set. I will try to isolate things and see what I can surmise.

@NightOwl888
Copy link
Collaborator

Possibly Related: #103

@NightOwl888
Copy link
Collaborator

Were you able to resolve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants