-
Notifications
You must be signed in to change notification settings - Fork 177
mv-init is not applied when storage returns "" (empty string) #438
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
Comments
Looks like there's definitely a bug at play here. Btw:
Here's an even more reduced testcase: https://codepen.io/leaverou/pen/OraoPy?&editors=1100#0 From that, I added two tests in the testsuite: Empty storage , Whitespace storage After investigating a little bit, it seems that this is actually the case of two bugs cancelling each other out, lol. The relevant bits in the code are: Note that in The two bugs are:
I suspect the fix would be one of the following:
The latter is probably conceptually better, but a bit tricky to do in a DRY way. |
Wow thank you for the in depth explanation and for the tips about html and the code pen. I can try to work on solving this. |
So I implemented
Regarding converting to a string I wasn't sure how to do that without introducing new bugs. My first inclination was to use |
Thanks for working on it! Regarding converting to a string, the safest way is just |
Thank you for the pointers. I really appreciate it. I'll see if I can put all of this together into a pull request. |
Uh oh!
There was an error while loading. Please reload this page.
I tried using pre elements to store data live and start data. However, the input field is not initialized unless there is at least one character of whitespace in the HTML element for storing the data, or the HTML element for storing the data is closed immediately i.e.
<pre id="foo"/>
which is bad. This issue is annoying because my editor automatically removes whitespace between empty tags so I cannot get the initial data to show up.Here is a codepen replicating the issue. the first mavo app shows the problem, the second mavo app is the expected behavior.
The text was updated successfully, but these errors were encountered: