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

The iron-localstorage-load-empty event is not fired when localStorage is cleared from another window. #44

Open
rhofland opened this issue Nov 20, 2016 · 1 comment

Comments

@rhofland
Copy link

rhofland commented Nov 20, 2016

Description

The iron-localstorage element handles the 'storage' event, which is fired when localStorage has been manipulated from another window. When localStorage.clear is called from another window, it clears all entries in the local storage and the 'storage' event is fired. iron-localstorage should be firing the iron-localstorage-load-empty event, but does not.

Expected outcome

'iron-localstorage-load-empty' should be fired when localStorage.clear is called from another window.

Actual outcome

'iron-localstorage-load-empty' isn't fired.

Live Demo

Steps to reproduce

  1. Put an iron-localstorage element with a default value in the page.
  2. echo the bound value on the page
  3. Open the page in chrome.
  4. Open up the Developer Tools
  5. Go to Application and check the value is in the Local Storage
  6. Go to Clear Storage section, and make sure 'Local and session storage' is checked and click 'Clear site data'. This fires the 'storage' event that iron-localstorage is listening for.
  7. Since this event isn't handled, the bound value won't update

Browsers Affected

All

@PaulHMason
Copy link

Ahhh, I'd really love it if the pull request for this issue was accepted - it will make my life a lot easier.

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

2 participants