-
Notifications
You must be signed in to change notification settings - Fork 595
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
issue with updating textarea state? #253
Comments
Hey there, thanks for opening this. Yeah, ran into this last week too. I think this is a bug in morphdom; it might be worth raising it there. Thanks! |
i recently ran into this bug: Raynos/min-document#42, related but only when you do |
Thanks @yoshuawuyts. I tried to reproduce the issue with morphdom and bel but everything works as expected there: 'use strict'
const bel = require('bel')
const morphdom = require('morphdom')
window.value = 'hello'
const textarea = renderTextarea(window.value)
const button = renderButton()
document.body.appendChild(textarea)
document.body.appendChild(button)
function renderTextarea (value) {
return bel`<textarea oninput=${onInput}>${value}</textarea>`
function onInput (e) {
window.value = e.target.value
render()
}
}
function renderButton () {
return bel`<button onclick=${reset}>reset</button>`
function reset () {
window.value = ''
render()
}
}
function render () {
morphdom(textarea, renderTextarea(window.value))
} Any other ideas what the issue might be here? |
@maximilianschmitt a morphdom patch was released 18 hours ago (you posted it 10 hours ago) - maybs it got fixed? |
Yes, works with newest morphdom thanks! :) can we expect an update to choo soon? :) |
@maximilianschmitt the patch for |
@yoshuawuyts Thanks! Unfortunately this isn't working. I tried |
@maximilianschmitt oh damn, you're right - this is the issue max-mapper/yo-yo#44 |
|
Hm, I don't know if I'm doing something wrong, but the example above does NOT work for me (the reset button doesn't change the value of the textarea) with the latest Choo / yo-yo / morphdom:
No feedback, no JavaScript error on the console... Any ideas? |
@emanchado odd, yeah can confirm. Still seems like a edit: requirebin link |
@yoshuawuyts did you see this? patrick-steele-idem/morphdom#88 (comment) Should I open a yo-yo issue instead? |
@emanchado yeah reckon that might be good |
I've modified the getting started code to keep it as minimal as possible:
Expected behavior
When I click reset, I'm expecting the textarea's value to be an empty string:
Actual behavior
Steps to reproduce behavior
Use this code to get the buggy application to work:
Add
value=${state.title}
to thetextarea
to get the desired behaviour.The text was updated successfully, but these errors were encountered: