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

Include value along with change event #9

Open
eamsden opened this issue Aug 10, 2015 · 4 comments
Open

Include value along with change event #9

eamsden opened this issue Aug 10, 2015 · 4 comments

Comments

@eamsden
Copy link

eamsden commented Aug 10, 2015

The current improved-base HEAD provides the change attribute which takes an action to run in the event of a change to a form element. There is however no way to actually access the value of the form element. Ideally the value changed to should be provided to the change handler.

@arianvp
Copy link
Contributor

arianvp commented Aug 10, 2015

We should probably properly rewrite this library once improved-base is out.

@luite
Copy link
Member

luite commented Aug 10, 2015

That's what I've already done, and I've added lot of stuff in the process (rendering manager, components, utilities for standard elements and events) :)

but the code is still rather new and some things don't quite work properly yet or are incomplete

I think you would normally access the value through the target of the event. Apparently I commented out the export of that name in the GHCJS.VDOM.Event module and left it unimplemented, so I must have felt undecided on something. Is this correct, or is there (in pure JavaScript) a more direct way to get the value?

If the above is correct, I don't think the value should really be passed in as an argument, but there should at least be some API to retrieve it.

@eamsden
Copy link
Author

eamsden commented Aug 10, 2015

This would require some means of reading an attribute (specifically value) from the target.

@eamsden
Copy link
Author

eamsden commented Aug 11, 2015

This sounds correct, but it's worth noting that the target will be a DOM element and not a VNode, which is a good thing as I'm not sure you can extract the updated value from a VNode. Is there a reason the commented-out target function has VNode as its result type?

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

3 participants