Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Filter field: Disable while waiting for async data #1464

Closed
thomaspink opened this issue Aug 10, 2020 · 6 comments · Fixed by #1490
Closed

Filter field: Disable while waiting for async data #1464

thomaspink opened this issue Aug 10, 2020 · 6 comments · Fixed by #1490
Labels
has-pr needs discussion P2 Issue that is important to resolve as soon as possible

Comments

@thomaspink
Copy link
Contributor

thomaspink commented Aug 10, 2020

Should the filter field be disabled while async data is loaded to prevent the user from deleting nodes that relate to the currently loaded data.

This can then lead to a broken state if the user removes the original async node (via backspace) while the request is still pending (See issue #1436 )

@lukasholzer
Copy link
Contributor

I think disabling without a reason would irritate the user as he might think he broke something by accident.

Maybe having a small loading distractor that provides feedback that something is ongoing would be the better approach but I would discuss this with @dynatrace-oss/ux-core – what is their opinion on that?

@thomaspink
Copy link
Contributor Author

@lukasholzer a loading-indicator is already shown while a request is pending. See this example.

The question is, how do (or should) we prevent the user from interacting with the filter field and causing an invalid state by accident, while loading async data. If not, we shift the handling to the consumer who has to implement a way to cancel the async request when the user interacts and maybe switches to a different node.

@kathrin-aigner
Copy link

kathrin-aigner commented Aug 11, 2020

I don't see a problem with disabling the field while the loading action is happening (If there is no additional loading indicator a small loading indicator instead of the filter can be placed so that the user knows what happens.) Is it somehow possible to cancel the loading action?

@thomaspink
Copy link
Contributor Author

@kathrin-aigner Yes. The consumer can cancel the loading.

@thomaspink
Copy link
Contributor Author

As discussed with UX we do not fully disable the filter field, only the input field should switch to a "readonly" mode so no characters (also backspace) can be entered. Removing completed tags (filters) should still be possible via click on the X

@dominikmessner
Copy link
Contributor

Will this affect all implementations, or will we be able to restore the old behavior? I think if the async request takes a long time to load, it might still be more convenient if the user is able to cancel it.

I also investigated the reason this bug came up in first place. Our filter field implementation/wrapper already handled cancelling the requests, but it looks like the events changed in one of the recent releases.
Previously onFilterChanges fired whenever the node was deleted, but since a few weeks we need to listen to onCurrentFilterChanged to detect these cases. Not sure if this was changed on purpose, or if it is a bug.

thomaspink added a commit that referenced this issue Aug 27, 2020
thomaspink added a commit that referenced this issue Aug 28, 2020
yngrdyn pushed a commit to yngrdyn/barista that referenced this issue Nov 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has-pr needs discussion P2 Issue that is important to resolve as soon as possible
Projects
None yet
4 participants