Fix for screen jumping to top when selecting dashboard model properties. To fix, removed useState call and moved selectedAsset state up to parent QueryEditor component.
In doing so found the following bugs and fixed them as well.
Asset Model RE keeps state of old selected asset properties after changing asset
fix: added clearing selected properties to useEffect of when asset changes
Asset Properties table does not change selection mode based on widget type
fix: passed in missing 'correctSelectionMode' prop into table
Asset Model Tab breaks if you add duplicate properties after edit/preview change
deduped properties in hook where we reduce properties to ids for later use
Overview
Fix for screen jumping to top when selecting dashboard model properties. To fix, removed useState call and moved selectedAsset state up to parent QueryEditor component.
In doing so found the following bugs and fixed them as well.
Asset Model RE keeps state of old selected asset properties after changing asset
Asset Properties table does not change selection mode based on widget type
Asset Model Tab breaks if you add duplicate properties after edit/preview change
Verifying Changes
https://github.com/user-attachments/assets/69206819-d696-496e-921a-ed3e73f28206
Legal
This project is available under the Apache 2.0 License.