Comments (4)
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.
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.
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.
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)
- Events don't behave correctly HOT 8
- touch event information
- (value) function returns null for <select><option>...</option></select> HOT 2
- Including Domina 1.0.0 in project.clj blocks some closure library access HOT 1
- events/listen! does not work with :optimizations :advanced (??) HOT 11
- Need to remove a 'y' in the readme.
- set-html! and event listeners HOT 1
- get-data/set-data! don't seem to work with "normal" data attributes HOT 5
- Bug in 'array-like?' that messes up selection of 'form' elements. HOT 1
- set-value! and value functions do not work as expected for checkboxes
- Some events don't work when specified as symbols
- domina 1.0.1 jar duplicate files HOT 7
- Clone already referenced & No XPathResult namespace HOT 7
- domina/nodes always returns an empty collection in :optimizations :simple
- Is there a way to avoid side effects when parsing html strings? HOT 2
- Move to a multi segment namespace HOT 3
- Key Codes not working properly on key events
- Issue selecting styles
- How to get around/fix/avoid annoying message about single segment namespace? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from domina.