Skip to content
This repository

Not populating <span> within Chrome/Safari? #246

Closed
jodriscoll opened this Issue · 23 comments

3 participants

Joseph O'Driscoll Felix Nagel AAverin
Joseph O'Driscoll

This is a first!
It seems to be populating the "selected" inside IE/Firefox, but not in Chrome/Safari!

Here is a working example:
http://www.massgeneral.org/top-doctors/default.aspx

Any help would be appreciated!

Felix Nagel
Owner
fnagel commented

I would assume you're missing / faulty CSS statements as its working just fine in the demo fiddle: http://jsfiddle.net/fnagel/GXtpC/

Joseph O'Driscoll

Any idea what it could be that I'm missing? Not sure why it would malfunction in only Chrome/Safari...

Felix Nagel
Owner
fnagel commented

As far as I can see there is no text within your span. Why? I have no idea? Did you make any chanegs to selectmenu? Using latest version?

Joseph O'Driscoll

I have no clue as well, which is the purpose of this support ticket...

It populates and works perfectly fine within Firefox and IE. It however, does not work in Chrome and Safari. If anyone can shed some light on what I did or what it's not doing, I would greatly appreciate it.

Felix Nagel
Owner
fnagel commented
Joseph O'Driscoll

Can you tell me exactly what you need from my end? I'm almost certain everything is accessible by the end user, however, I can produce a fiddle if need be.

Joseph O'Driscoll

Alright, I produced a fiddle for you!

http://jsfiddle.net/jodriscoll/qNKxX/1/

However, when I view the fiddle in Chrome/Safari, it works! However, it does NOT work when I view it on the environment it's meant to live on... Any ideas?

Felix Nagel
Owner
fnagel commented

Im able to access your demo (http://www.massgeneral.org/top-doctors/default.aspx) but its pretty hard to track the origin of the problem. What we need is a stripped down, minimal version of the problem. Or perhaps its easier to make a standalone zip out of it?

Problem is it could be so much. Other Java-Scripts, doctype or some kind of strange side effects cause of whatever. Some ideas: You shouldnt use multiple JS libs at the same time. Try removing dojo and mootools libraries. Change doctype to strict, remove empty lines before doctype. Remove other scripts.

Joseph O'Driscoll

In terms of the overall JS library, I'm unable to modify that. Trust me, I wish I could, but I can't :(

The odd part, was that it was working until I fully skinned the UI for the drop box. Which means, at some point, some form of CSS or something, managed to throw it out of wack in those two browsers. Do you have any idea what could of caused it to not populate in only 2 browsers?

Felix Nagel
Owner
fnagel commented
Felix Nagel
Owner

Did you manage to fix your problem?

Joseph O'Driscoll
AAverin

Confirm the issue.
Seems like when select doesn't have initial value set
Firefox does set value to 0 index on blue
Chrome does not, returning null
That might result in unpopulated 'selected' if nothing was actually selected by user and only default element was highlighted

AAverin

And here's the underlying cause of that: http://code.google.com/p/chromium/issues/detail?id=143632

Joseph O'Driscoll

AAverin, great work! What would you suggest as a solution for the current issue presented on the page I provided?

AAverin

Here's what I did in my code for chrome. You could try something similar
if (select[0].value == "") {
select[0].value = select[0].options[0].value;
}

Joseph O'Driscoll

I just attempted to implement this JS to the template and it still is producing a blank result within the select box. Any ideas on what can be conflicting with it from your research?

AAverin

seems like this chrome issue isn't going to be fixed, so I'd suggest to implement some global fix in selectmenu.value method. At the moment value method uses empty assignment to clear select to initial state, which is broken in chrome.

http://code.google.com/p/chromium/issues/detail?id=143632
https://bugs.webkit.org/show_bug.cgi?id=67233

jodriscoll, not sure what might be wrong in your case, just read through issue case notes, maybe it'll give you some new ideas. Basically, setting select value that's not present in list result in empty select for Chrome, so maybe you'll need to modify my snippet in some way.

Felix Nagel
Owner
Felix Nagel
Owner

Any feedback on this issue?

Felix Nagel
Owner

Any feedback on this issue?

Felix Nagel
Owner

Closed as no feedback was given. Please reopen if needed!

Joseph O'Driscoll

fnagel, I will be researching this bug next week! I will report back once I've spent some time figuring out the issue again. My apologies for the delayed response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.