Giter Site home page Giter Site logo

Comments (4)

levand avatar levand commented on September 23, 2024

Thanks for the report: I'll take a closer look.

DomContent is not intended to complect the notion of parenthood and node collections. It is intended to regard a single node as a single node, whether or not it has children.

Unfortunately, some browsers implement the NodeList (or a similar) interface on certain nodes, with respect to their children, causing unintentional complection. I saw that happen on button groups before, my guess is that that's what's happening with html elements as well.

Unfortunately the only solution is to special-case those elements; I'll take a look and see if that's indeed what's going on.

from domina.

masklinn avatar masklinn commented on September 23, 2024

Well I've just hit this issue and it's a rather frustrating one.

FWIW, it's probably because as per spec HTMLFormElement is array-like for its controls (except image buttons): it has a length property and can be indexed.

I think the problem here is that the array-like filter is incorrect: it's possible (and indeed trivial) to have nodes with no name attribute (and the comment is incorrect, a select with no explicit @name will be considered array-like — the default @name is "") which I'm pretty sure is unexpected).

Either the filter should be replaced by nodeName (or a typecheck on Node or HTMLElement if that works in all browsers), or the check should be that name is undefined (for elements with a @name, the default value is the empty string). The latter will still be error-prone, but less-so.

from domina.

malcolmsparks avatar malcolmsparks commented on September 23, 2024

I think there's a good case for type check on HTMLElement . The current behaviour violates the principle of least surprise: http://en.wikipedia.org/wiki/Principle_of_least_astonishment for its intended audience (developers). I hope and expect that ClojureScript gains a much increased audience as it begins to offer advantages beyond simply LISP syntax (as show by David Nolen's recent demonstrations) and Domina is a very useful and fundamental library (and used in Pedestal) - it would be beneficial to many if this kind of thing were fixed because it can lead to hours of frustration for the unwary developer, enough to put them on CLJS for good -

from domina.

ckirkendall avatar ckirkendall commented on September 23, 2024

This was due to an issue with selecting on form nodes without a name attribute in some browsers. This has been addressed in 1.02-SNAPSHOT.

from domina.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.