waseem02 / jquery-asmselect

Automatically exported from code.google.com/p/jquery-asmselect
0 stars 0 forks source link

Javascript error with ie6 and ie7 (can be reprodusced also with IETester ) #35

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  Use Ie6 or Ie7 with
http://www.ryancramer.com/journal/entries/select_multiple/
2.  select some values
3.  select some same value again (it's disabled but with ie6 and 7 you can)
4.  select the title option (eg  'Select some categories')

What is the expected output? What do you see instead?
Expecting nothing -> got js error.

What version of the product are you using? On what operating system?
windows jquery currewnt and asmselect 1.0.4a beta

Please provide any additional information below.

offending (.attr('rel', optionId))  line 262 :      
    var $item = $("<li></li>")
        .attr('rel', optionId)
    .addClass(options.listItemClass)
    .append($itemLabel)
    .append($removeLink)
    .hide();

Original issue reported on code.google.com by mikko.la...@mediware.fi on 26 Oct 2009 at 3:03

GoogleCodeExporter commented 8 years ago
I get this behaviour with IE8 too! Regardless of whether compatibility view is 
on.

Scenario: a multi-select with 1 item already selected.
Steps:
1. select a second item
2. remove the item that was just selected.
3. upon clicking the drop-down, the error occurs.

jquery.asmselect.js: line 262:  attr(...) is null or not an object

Original comment by petersum...@gmail.com on 24 Jan 2010 at 4:52

GoogleCodeExporter commented 8 years ago
Quick work-around (not widely tested - but fixes the problem on IE8):

change line 127 from:

addListItem(id);

to:

if (id) {
  addListItem(id);
}

-- 

This stopped the bug from occurring in my environment.

Original comment by petersum...@gmail.com on 24 Jan 2010 at 5:01

GoogleCodeExporter commented 8 years ago
confirmed: the suggested fix also works on IE6

Original comment by cykedeli...@gmail.com on 29 Jun 2010 at 9:55

GoogleCodeExporter commented 8 years ago
update: on IE6, the said work-around does fix the issue, but a different issue 
arises, that lets you add an already-selected item twice.

suggested modification to the work-around is to 'widen' the if-block to include 
the next two lines. i.e., from:

if (id) {
  addListItem(id);
}

Change To:

if (id) {
  addListItem(id);
  ieClick = false; 
  triggerOriginalChange(id, 'add');
}

Original comment by cykedeli...@gmail.com on 29 Jun 2010 at 10:07

GoogleCodeExporter commented 8 years ago
Thanks for posting this fix. I am including it in 1.0.5.

Original comment by ryancram...@gmail.com on 10 Jul 2010 at 4:02