uni-virtualizer icon indicating copy to clipboard operation
uni-virtualizer copied to clipboard

rangechange event properties are undefined in Safari

Open alangdm opened this issue 6 years ago • 0 comments

Hi there,

I was testing out lit-virtualizer and found a bit of a weird behavior in Safari (both MacOS and iOS)

When listening to the rangechange event, and trying to access to it's properties like this

virtualizer.addEventListener('rangechange', 
  ({first, last, firstVisible, lastVisible}) => {
    console.log(first, last, firstVisible, lastVisible);
  });

In Chrome everything works fine, but in Safari they are all undefined I can access them in both Chrome and Safari as _first, _last etc., but I don't think that's how they're intended to be used

Affected Version

lit-virtualizer 0.3.0

Affected Browsers

  • iOS Safari 12.4
  • MacOS Safari 12.1.2

How to reproduce

  1. Add a lit-virtualizer component and listen to the rangechange event
  2. Try to access the first, last, firstVisible, or lastVisible properties of the event

Workaround

  • Use the _first, _last, _firstVisible, and _lastVisible properties

Screenshots

Safari Console lit-virtualizer rangechange safari Chrome Console lit-virtualizer rangechange chrome

alangdm avatar Aug 14 '19 07:08 alangdm