components
components copied to clipboard
[SL-GRID] sl-event is fired multiple time after initialization
Provide a general summary of the issue here
When a DataSource is used combined with a Grid. The sl-update event is fired multiple (4 or more) times, directly after initialization of the grid.
Consider the code below (the onUpdate method is directly executed multiple times):
this.dataSource = new ArrayDataSource(people as Person[]);
this.dataSource.addEventListener('sl-update', this.#onUpdate);
๐ค Expected Behavior?
The sl-update event should only fire if a user changes the sort order for example.
๐ฏ Current Behavior
see general summary
๐ Possible Solution
n/a
๐ฅ๏ธ Steps to Reproduce
see also this demo project to reproduce this issue
- git clone https://github.com/fransdeboer/grid-poc.git
- execute
npm ito install all packages - run the code with
npm run dev - open a browser window at http://localhost:5173/
- open the DevTools of the browser and in the console a few messages sl-update fired are logged. Where none where expected.
What browsers are you seeing the problem on? (only for bugs in code)
Chrome
If other, please specify.
No response
What operating system are you using?
WSL
๐ค Your name
Frans de Boer
๐งข Your product/team
Magister
๐จ Your Theme(s)
Magister