ClojureScript

checkboxes 'indeterminate' attribute gets munged in advanced mode

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
  • Environment:
    ClojureScript 0.0-1853, Clojure 1.5.1, Java 1.6.0_51, OS X 10.7.5

Description

HTML5 defines an indeterminate attribute for checkboxes
http://www.w3.org/TR/html5/forms.html#checkbox-state-(type=checkbox)
Trying to set this attribute with ClojureScript
(set! (.-indeterminate checkbox-element) true))
doesn't work when compiling in advanced mode.

Looking at the generated JavaScript code, I see that the indeterminate property gets munged. I don't know which externs files the ClojureScript compiler uses by default, but the indeterminate property is not referenced in Closure Compiler's externs for HTML5
https://code.google.com/p/closure-compiler/source/browse/externs/html5.js

In my project I've worked around this by adding this to my own externs file

/** @type {boolean} */
HTMLInputElement.prototype.indeterminate;

but I guess this should be "built-in" into the ClojureScript compiler (or Google's Closure Compiler)?

Activity

Hide
Jozef Wagner added a comment -

This issue should be addressed in the Closure Compiler bugtracker

Until they fix it, you can use your own externs file (tutorial), which is a perfectly valid approach.

Show
Jozef Wagner added a comment - This issue should be addressed in the Closure Compiler bugtracker Until they fix it, you can use your own externs file (tutorial), which is a perfectly valid approach.
Hide
Xavi Caballé added a comment -

ok, thanks.
I just submitted a patch to fix this in the Closure Compiler
https://code.google.com/p/closure-compiler/issues/detail?id=1068

Show
Xavi Caballé added a comment - ok, thanks. I just submitted a patch to fix this in the Closure Compiler https://code.google.com/p/closure-compiler/issues/detail?id=1068

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: