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

Data binding breaks with 2 app-localstorage-document elements referencing the same key #75

Open
karakonjul opened this issue Nov 18, 2016 · 0 comments

Comments

@karakonjul
Copy link

karakonjul commented Nov 18, 2016

Description

I have a JSON-serialized object in localStorage and two separate app-localstorage-document elements referencing it at the same time. Then I have a text input bound to a property of the stored object (2-way) using one app-localstorage-document, and then a read-only binding of the same property to a text label, but using the other app-localstorage-document. When the property is changed via the input the text label gets updated once, but then the binding breaks and it stops reflecting the changes in the input. The value seems to be correctly written to localStorage.

In my particular case I have the app-localstorage-document elements in different parts of the application, so I can't just use the same one.

Expected outcome

Both labels should contain the same value, which should reflect the contents of the input

Actual outcome

The first label is correctly kept synchronized with the input, but the second label is updated only on the first change and then the binding is broken. The second label uses a different app-localstorage-document.

Live Demo

https://output.jsbin.com/kehabulitu
http://jsbin.com/meqijot

Steps to reproduce

Just type something in the input and observe the 2 labels above. Type in at least 2 characters!

Browsers Affected

all

karakonjul pushed a commit to karakonjul/app-storage that referenced this issue Nov 22, 2016
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

1 participant