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

When creating a question in Firefox, can't get past the select a recipient stage #54

Closed
evz opened this issue Aug 16, 2013 · 13 comments
Closed
Assignees
Labels

Comments

@evz
Copy link
Member

evz commented Aug 16, 2013

Despite having filled out the form properly and selected my recipient, Firefox always thinks I haven't chosen a recipient. Each time I hit the "Next" button, it duplicates the error message (See screen shot). This same functionality works for me in Chrome and Safari on OS X.

screen shot 2013-08-16 at 3 46 33 pm

@walter
Copy link
Contributor

walter commented Aug 16, 2013

Good catch. Is this something up your alley to debug?

@derekeder
Copy link
Contributor

sure, @evz and will take a look

@evz
Copy link
Member Author

evz commented Aug 17, 2013

I think I found the offending line of coffee script.

Firebug reports that length as 0 even when there is something selected:

screen shot 2013-08-16 at 8 46 35 pm

Webkit (in this case Safari) gets a value there:

screen shot 2013-08-16 at 8 46 57 pm

That's about as far as I can take this tonight (brain is running out of juice).

@evz
Copy link
Member Author

evz commented Aug 17, 2013

So, I'm pretty sure I came up with a solution for the bad jquery selector:

$('input[name="question[person_id]"][checked="checked"]').length is 0

Subtle difference but it seems to make at least Firefox happy. However, now that I'm past that step, and I complete the process of filling out the question, I end up back at the beginning, only with the old layout:

screen shot 2013-08-17 at 8 49 38 am

If I go through the process again, I get all the older layouts (only the forms are already filled out with the stuff I put in earlier) and then when I hit the "Publish" button again, I end up back at the beginning again. This is only true for me in Firefox. Safari, Chrome, etc perform as expected.

Anyways, I'll probably have a bit of time in a few hours to take a deeper look here. If someone @derekeder or @walter happens to get to it before me, I won't be offended.

@walter
Copy link
Contributor

walter commented Aug 17, 2013

So a few things are happening here. Let's step through them.

$('input[name="question[person_id]"][checked="checked"]').length is 0

Shouldn't this be length is 1? Basically the user should not be able to proceed unless they do have a checked input.

I'm a tad confused about this actually as it looks to contradict "things are working in Safari and Chrome".

What it boils down to is that question[person_id] has to have a person's id passed to questions#create or server side validation will fail. If your solution has the side effect of unsetting a value for question[person_id], it's not complete.

We may need to backburner this. I don't want to eat too much more or your limited time on a browser compatibility issue.

@evz
Copy link
Member Author

evz commented Aug 19, 2013

Actually, if that line evaluates as true, the personError function is triggered and the valid flag is made false so the form won't submit (that's why it wasn't working in Firefox because that line was always evaluating as true in Firefox).

I'll back off on this stuff for now and we can focus on other stuff. I'll just go ahead and make sure I'm doing my dev work in Chrome/Safari so it actually works for me.

@walter
Copy link
Contributor

walter commented Aug 19, 2013

One thing we could have tried is running questions_spec with selenium under Firefox as Capybara's driver. That would, in theory, recreate the issue in probably a number of tests.

@walter
Copy link
Contributor

walter commented Sep 12, 2013

@evz, worth double checking this is still an issue.

@evz
Copy link
Member Author

evz commented Sep 12, 2013

Yup, still appears to be an issue (assuming oglocal is up to date)

screen shot 2013-09-12 at 9 06 49 am

@davidmooreppf
Copy link
Member

Yep, still a bug in FF. As we know, haha.

@ghost ghost assigned acacheung and walter Sep 29, 2013
@walter
Copy link
Contributor

walter commented Dec 4, 2013

23.0.1 still has issue, as does newest 25.0.1. @acacheung is this something that dockyard could help sort out?

@maryamgunja
Copy link

@davidmooreppf

Experiencing same problem when looking up twitter account on Firefox:
screen shot 2014-01-22 at 11 28 20 am

@walter
Copy link
Contributor

walter commented Jan 22, 2014

I've already started looking into all of the issues related to recipients. I'll keep you posted.

walter added a commit that referenced this issue Jan 22, 2014
JavaScript refactor away from problematic use of keyup & change in favor
of "input" event from HTML5. Needs testing in IE8.

Supports #54 & #255
@walter walter closed this as completed in 91cb029 Jan 22, 2014
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

6 participants