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

Handlebars dropdown list "selected" option does not work on IE8/9 #496

Closed
utsengar opened this Issue Nov 20, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@utsengar

utsengar commented Nov 20, 2012

Steps to reproduce:

  1. meteor create test
  2. Copy test.js and test.html from: https://gist.github.com/4120133
  3. Run: meteor

The dropdown "selected" option works fine on firefox and chrome. But does not work on IE8 or 9.

This has also been reported here: http://stackoverflow.com/questions/13465524/select-tag-default-selection-ignored-by-ie8-when-using-handlebars-with-meteor

@avital

This comment has been minimized.

Contributor

avital commented Nov 20, 2012

Could you please put this on a Github repository so that the instructions
read as follows?

  1. git clone <...>
  2. run meteor

Also could you explain precisely how to repro the issue - which browser to
use, what action to take, what is the observed behavior vs expected
behavior?

On Tue, Nov 20, 2012 at 11:14 AM, Utkarsh Sengar
notifications@github.comwrote:

Steps to reproduce:

  1. meteor create test
  2. Copy test.js and test.html from: https://gist.github.com/4120133
  3. Run: meteor

The dropdown "selected" option works fine on firefox and chrome. But does
not work on IE8 or 9.

This has also been reported here:
http://stackoverflow.com/questions/13465524/select-tag-default-selection-ignored-by-ie8-when-using-handlebars-with-meteor


Reply to this email directly or view it on GitHubhttps://github.com//issues/496.

@utsengar

This comment has been minimized.

utsengar commented Nov 20, 2012

Setup

  1. git clone https://github.com/utkarsh2012/meteor-dd-bug.git
  2. meteor
  3. Go to: http://localhost:3000

Expected

As the page loads, the default option in the dropdown should be: "File not found" (because of the handlerbar helper in test.js: line 6 and 10

Observed

On Firefox 16 and chrome, it works fine: http://i.imgur.com/czHJI.png
On IE8 and 9, the default option is "Yay" and the handlerbar helper logic is ignored: http://i.imgur.com/zxbZI.png

@avital

This comment has been minimized.

Contributor

avital commented Nov 20, 2012

Thanks for the quick response! We'll investigate this but since we are
around Thanksgiving now it may take a bit longer than usual.

On Tue, Nov 20, 2012 at 11:35 AM, Utkarsh Sengar
notifications@github.comwrote:

Setup

  1. git clone https://github.com/utkarsh2012/meteor-dd-bug.git
  2. meteor
  3. Go to: http://localhost:3000

Expected

As the page loads, the default option in the dropdown should be: "File not
found" (because of the handlerbar helper in test.js: line 6 and 10
Observed

On Firefox 16 and chrome, it works fine: http://imgur.com/czHJI
On IE8 and 9, the default option is "Yay" and the handlerbar helper logic
is ignored: http://imgur.com/zxbZI


Reply to this email directly or view it on GitHubhttps://github.com//issues/496#issuecomment-10569279.

@glasser glasser closed this Nov 28, 2012

@glasser

This comment has been minimized.

Member

glasser commented Nov 28, 2012

This is fixed on the spark-original-value branch. Hopefully will land on devel Friday or Monday.

glasser added a commit that referenced this issue Nov 28, 2012

Fix DomUtils.htmlToFragment with SELECTs. Add helpers.
When a <SELECT> was rendered on IE9 (or older) via DomUtils.htmlToFragment, the
hack we used somehow failed to properly set some attributes; they would show up
in innerHTML but not affect property values. eg, SELECTED would show up in an
OPTION's innerHTML but option.selected would not be set (nor would the parent
SELECT's value or selectedIndex). Fix this by replacing a mergeAttributes call
with an explicit attribute copying loop.

Also, add the helpers setElementValue and getElementValue to DomUtils, which are
used both in the test of this fix and will be used in a future change.

Fixes #496.

glasser added a commit that referenced this issue Dec 1, 2012

Fix DomUtils.htmlToFragment with SELECTs. Add helpers.
When a <SELECT> was rendered on IE9 (or older) via DomUtils.htmlToFragment, the
hack we used somehow failed to properly set some attributes; they would show up
in innerHTML but not affect property values. eg, SELECTED would show up in an
OPTION's innerHTML but option.selected would not be set (nor would the parent
SELECT's value or selectedIndex). Fix this by replacing a mergeAttributes call
with an explicit attribute copying loop.

Also, add the helpers setElementValue and getElementValue to DomUtils, which are
used both in the test of this fix and will be used in a future change.

Fixes #496.

glasser added a commit that referenced this issue Dec 4, 2012

Fix DomUtils.htmlToFragment with SELECTs. Add helpers.
When a <SELECT> was rendered on IE9 (or older) via DomUtils.htmlToFragment, the
hack we used somehow failed to properly set some attributes; they would show up
in innerHTML but not affect property values. eg, SELECTED would show up in an
OPTION's innerHTML but option.selected would not be set (nor would the parent
SELECT's value or selectedIndex). Fix this by replacing a mergeAttributes call
with an explicit attribute copying loop.

Also, add the helpers setElementValue and getElementValue to DomUtils, which are
used both in the test of this fix and will be used in a future change.

Fixes #496.

glasser added a commit that referenced this issue Dec 4, 2012

Fix DomUtils.htmlToFragment with SELECTs. Add helpers.
When a <SELECT> was rendered on IE9 (or older) via DomUtils.htmlToFragment, the
hack we used somehow failed to properly set some attributes; they would show up
in innerHTML but not affect property values. eg, SELECTED would show up in an
OPTION's innerHTML but option.selected would not be set (nor would the parent
SELECT's value or selectedIndex). Fix this by replacing a mergeAttributes call
with an explicit attribute copying loop.

Also, add the helpers setElementValue and getElementValue to DomUtils, which are
used both in the test of this fix and will be used in a future change.

Fixes #496.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment