debois / elm-dom Goto Github PK
View Code? Open in Web Editor NEWDOM traversal for Elm event-handlers
DOM traversal for Elm event-handlers
With the arrival of Browser.DOM
a lot of things like https://package.elm-lang.org/packages/debois/elm-dom/latest/DOM#boundingClientRect won't be nececassary anymore. It would be good to mention that in the docs to not mislead Elm newcomers.
Hi there,
I've identified an issue where the position
decoder fails when trying to determine the position of an SVG in Internet Explorer 11. The issues stems from the parentElement
decoder trying to decode the parentElement
field on an SVG node. (https://stackoverflow.com/questions/8685739/difference-between-dom-parentnode-and-parentelement)
parentElement : Decoder a -> Decoder a
parentElement decoder =
field "parentElement" decoder
SVGs in IE11 do not have this attribute, instead they use parentNode
.
However, this decoder works
parentElement : Decoder a -> Decoder a
parentElement decoder =
Decode.oneOf
[ field "parentElement" decoder
, field "parentNode" decoder
]
I've tried opening a pull request with this fix, but I've been unable to do so.
thanks
John
Possible solution here, however, proper support for getBoudingClientRect is apparently on its way, so I won't do any more on this for now.
Would it be possible to not just read fields that live on other DOM nodes, but also to call events (i.e. focus)?
I think elm's decoder only accounts for JSON types, is there a way to support IO producing functions as well?
When using elm-dom
scrollTop
the decoder fails silently.
I had to use int
instead of float
to get this to work
scrollTop : JD.Decoder Int
scrollTop =
JD.at [ "target", "scrollTop" ] JD.int
Required by: debois/elm-mdl#253
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.