dhamaso / ufd

Automatically exported from code.google.com/p/ufd
GNU General Public License v2.0
0 stars 0 forks source link

Calling destroy without labels causes error #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Initialize UFD on run-time (clone <p> with <select> inside and trigger 
.ufd() on this select)
2. Call .udf('destroy') before deleting this <p>

What is the expected output? What do you see instead?
Expected is removing UFD without errors :)
Instead I get error on line 1018.
There is other udf-ed select on this page with ID attribute. Looks like UFD 
assumes that select with ID must have associated label and tries to handle it 
on destroy.

What version of the product are you using? On what operating system?
0.6, UI 1.8.11, Firefox 3.6.16-pl.

Please provide any additional information below.
Commenting out this line fixes the problem, but it's a dirty hack :)

Original issue reported on code.google.com by borys.po...@gmail.com on 10 Apr 2011 at 5:15

GoogleCodeExporter commented 9 years ago
Ah, yes.  Just came across this one as well.  It actually causes everything to 
halt.  Quite nasty.

Instead of commenting out the line, I just check whether labels is null before 
using it:
if (this.labels != null)
    this.labels.attr("for", this.selectbox.attr("id")); //revert label 'for' attributes.

Original comment by aru...@anm.org on 12 Jul 2011 at 11:57

GoogleCodeExporter commented 9 years ago
I have the same problem and this solve the problem:
if (this.labels != null)
    this.labels.attr("for", this.selectbox.attr("id")); //revert label 'for' attributes.

Thx

Original comment by jayce....@gmail.com on 1 Aug 2011 at 12:36

GoogleCodeExporter commented 9 years ago
Yes sorry, that is nasty - any select without an ID attr at UFD-init time can't 
be destroyed.  Fixed in trunk.

http://code.google.com/p/ufd/source/detail?r=265

Original comment by thetoolman on 5 Oct 2011 at 10:56