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

version 1.8 seems not to work on <select><option> with empty value #55

Closed
BartTriple opened this issue Jul 25, 2014 · 6 comments
Closed
Assignees
Labels
Milestone

Comments

@BartTriple
Copy link

when using version 1.7 from the demo all works as expected, in version 1.8 changes on select are not captured?
mycode:
Select Adama Greystone

@joelbarker2011
Copy link

I can verify that this problem exists in 1.8.0. Create a form with a select box; make the select box's default value blank. When the select box is changed to a different (non-blank) value, the "dirty" event is not fired. (Testing in Firefox 31, the select box's "onchange" event DOES still fire. Changing other input fields on the form still fires the "dirty" event.)

This problem does not occur when the select box has a non-blank value to start with.

@tus124
Copy link

tus124 commented Aug 5, 2014

I agree. It seems like code is mistakenly takes blank value with undefined. Earlier version 1.5 does not have this issue.

@DevanB
Copy link

DevanB commented Aug 11, 2014

Someone should consider merging this in. We are having this problem. I just decided to do the hard code change in our local file since I can't wait for this to be merged in.

Did notice that with the change, if you change the value from a blank value, it fires the dirty event, but if you change it back to the value that it was upon loading the page, it doesn't fire a clean event.

@codedance
Copy link
Owner

Hi Guys, Sorry about being offline for a few days. I agree. There is already a related change in the 1.9-dev branch. I'll look at releasing 1.9 and ensuring the use-case outlined here is also address.

Just a git of history: In older versions of Are-You-Sure, we handled selects by converting to a string manually by looping through selected elements and concatenating a string. This code was a bit hacky but worked. It was cleaned up to use the .val() array return - this removed about 15 lines. The downside has been a few side-effect related bugs.

@codedance codedance added the bug label Aug 12, 2014
@codedance codedance added this to the 1.9 milestone Aug 12, 2014
@codedance codedance self-assigned this Aug 12, 2014
@codedance
Copy link
Owner

I did a bit of testing and playing around with a few alternate solutions. I've decided to revert select handling back to the 1.7 logic. It's a little more complicated, but it works on all versions of jquery back to 1.4 and stood the test of time for the past few years.

I agree this is an annoying bug so I'll push version 1.9 today.

@joelbarker2011
Copy link

This has corrected the problem for me. Thanks!

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

5 participants