enso-ui / select

Select
MIT License
2 stars 3 forks source link

Disable-on-load parameter #3

Closed jlsjonas closed 5 years ago

jlsjonas commented 5 years ago

This is a feature request.

Description

Going forward from https://github.com/laravel-enso/Select/pull/31#issuecomment-465507112, while it is technically possible to add overlays / readonly to VueSelect; properly handling it externally is finicky as the select can still trigger a load right after load finished, causing inconsistent behaviour.

I suggest adding a disable-on-load parameter to prevent modifications (similar to readonly) while fetching data.

Steps to Reproduce

  1. create a select that indirectly feeds data into itself (parent_id)

Expected behavior

Unable to select a child of the parent in-between updates

Actual behavior

list remains clickable, when using @fetch & @input to toggle readonly there's still cases where the wrong item could be selected (right after the readonly update, post-fetch, when clicking the select it does another fetch; which allows readonly to be set to false when the actual fetch occurs.

Since these don't cause input (or other) events there's no obvious way to externally keep track of these.

jlsjonas commented 5 years ago

The UX feels completely off with https://github.com/enso-ui/select/commit/8ac592c67b03ff4b1a2613696547c9e364942cbc: as user you it feels like the clicked-on item got processed even if it didn't. and I noticed the list & thus fetch calls) being updated briefly before loading is false; causing confusing behaviour.