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

at won't select children of a form #56

Closed
theJohnnyBrown opened this issue Aug 10, 2013 · 4 comments
Closed

at won't select children of a form #56

theJohnnyBrown opened this issue Aug 10, 2013 · 4 comments

Comments

@theJohnnyBrown
Copy link

In google chrome, debugging generated source,

fel = document.querySelector(dommy.core.selector.call(null, "#contactForm"));

enfocus.core.at.call(null, 
    fel, 
    cljs.core.PersistentVector.fromArray(["input"], true), 
    function(x){console.log(x);})
// logs nothing

enfocus.core.at.call(null, 
    fel.parentElement, 
    cljs.core.PersistentVector.fromArray(["input"], true), 
    function(x){console.log(x);})
// logs each of the form's inputs.
@ckirkendall
Copy link
Owner

I ran across this last week. Its actually a bug in domina. The bug is related to detecting if a node list is array like. It checks for a name field to detect form and select nodes. If the form doesn't have a name field it doesn't work. I will submit a pull request to domina or redefine this method in enfocus.

(defn- array-like?
  [obj]
  (and obj ;; is not nil
       (not (.-name obj)) ;; is not an element (i.e, <select>)
       (.-length obj))) ;; has a length

Creighton

@ckirkendall
Copy link
Owner

@theJohnnyBrown I now have commit rights to domina and will be able to make the fix.

@ckirkendall
Copy link
Owner

I fixed this in 1.0.2-SNAPSHOT of domina. Once domia 1.0.2 is released it will be fixed in enfocus.

@ckirkendall
Copy link
Owner

This has been fixed in enfocus 2.0.0-beta3.

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

No branches or pull requests

2 participants