Skip to content

IE/Edge can't sync local-storage data #110

@sizuhiko

Description

@sizuhiko

Description

Hi
when listen data-changed from app-localstorage-document, it is not changed data of the tag or event.

IE11/Edge were not set new value to storage at timing of onstorage event.

I checked IE11/Edge on Win10, set break point to this line, this.data is not changed.

I solved my environment followings:

this.listen(window, 'storage', '_dataChanged');

_dataChanged: function(event) {
  if (event && event.newValue) {
    // Only IE11 set newValue as String, should parse to JSON
    var value = (typeof event.newValue === 'string') ? JSON.parse(event.newValue) : event.newValue;
    ....
  }
},

New value is able to get from event.newValue.
see https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onstorage

Expected outcome

when data-changed, be able to get changed value from app-localstorage-document.data or
event.detail.value.

Actual outcome

IE/Edge catch event data-changed, but app-localstorage-document.data or
event.detail.value is not changed.

Browsers Affected

  • Chrome
  • Firefox
  • Safari 9
  • Edge
  • IE 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions