Skip to content
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

hoplon.goog do! sets attributes to "null" instead of removing them when val is nil #174

Closed
thedavidmeister opened this issue Jan 23, 2017 · 2 comments
Assignees
Labels

Comments

@thedavidmeister
Copy link
Contributor

Just noticed this when running my test suite requiring hoplon.goog instead of hoplon.jquery.

Expected:

(div :data-foo (cell= (when foo "foo")))
(reset! foo true)
; <div data-foo="foo"></div>
(reset! foo false)
; <div></div>

Actual:

(div :data-foo (cell= (when foo "foo")))
(reset! foo true)
; <div data-foo="foo"></div>
(reset! foo false)
; <div data-foo="null"></div>

This at least breaks [data-foo] style CSS selectors that only look for the existence of the attribute.

@burn2delete
Copy link
Member

@thedavidmeister thanks for reporting this, i'll get a patch in.

@burn2delete burn2delete self-assigned this Jan 23, 2017
@burn2delete
Copy link
Member

looking at the code for this one, appears that both are plagued with the same problem, values are always passing the (= false v) check, the difference is that jquery is correctly handling the nil case.

The fix is to change (if (= false v) ... -> (if-not v ... patch to follow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants