question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

UX: Does it make sense to always close Open/Save Dialog when clicking the action button?

See original GitHub issue

Been working a lot with OpenDialog, and noticed that when clicking the ‘Open’ button, the dialog always closes, regardless of the state of the selector window. Looking at the source for the button, it is hardwired to just say it’s not canceled and immediately close the dialog when this button is clicked. As someone who works with users and UX a lot, does this make sense? On these dialogs (open/save) there is two options: Cancel and (Open/Save (I’ll call it the action button from here on out). Clicking cancel will immediately close the dialog and say it was canceled. But clicking the action button at any time also will close the dialog, regardless of whether the select item(s) are actually valid.

Does this make sense, from an end user perspective? I get that the developer can check the result of the dialog, to see if it matches what they expect. But from an end user perspective, does this dialog behave like one would expect? In my testing and use of the library, it doesn’t seem to feel like it - if I have a file selector for example, I can still click open on a folder that is highlighted. On other platforms (such as Windows) clicking ‘Open’ when in file chooser mode, when a folder is selected, makes it open the folder (navigate into it). In folder chooser mode on windows, clicking ‘Open’ on a folder opens that folder, and having none selected opens the current folder (which if I recall is how this library currently behaves in folder mode now).

I know having a button dedicated to closing dialog is good, but that is already handled by the cancel button. I feel like if the user selects the action button, there should be a valid result set on the dialog’s variables (FilePath/FilePaths), as part of the API agreement: Open a dialog and get me a valid (filepath/folderpath)(s), OR get me nothing if the user cancels. Right now it is Open a dialog and maybe get me a valid file/folderpaths, OR get me nothing if the user cancels. Maybe this is by design, but it seems weird having a dialog that opens file browser but can return invalid results. I get it is still up to the dev to check the results, because users be users.

I wrote some code to test if the selection was valid, but I did not commit or make a PR for it as I was not sure if this was intended behavior. As I am somewhat of an ‘end user’ of this library, I think the file selection behavior seems a bit… off, maybe not totally incorrect. In my local code I had, I made a new method that checked if the selection was valid in FileDialog, based on if it was a OpenDialog or a SaveDialog (as it seems the base dialog has no way of knowing what kind it is, I just used a if (this is OpenDialog). I got it to work for single file selection, but I wasn’t sure how to handle multi file selection (I don’t use this feature so I haven’t looked at the code).

Just wondering what thoughts on this behavior are. Sorry for making so many issues, I know you’re trying to lock down API changes soon so I’m getting all of them in 😉

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Mgamerzcommented, Aug 16, 2020

It may take me a bit to get to this, but I’ll try it once I get a bit of time.

1reaction
tigcommented, Aug 15, 2020

No stress. This is all for fun and learning anyway so @bdisp and I will happily help as you make progress!

Read more comments on GitHub >

github_iconTop Results From Across the Web

UX: Does it make sense to always close Open/Save Dialog ...
Been working a lot with OpenDialog , and noticed that when clicking the 'Open' button, the dialog always closes, regardless of the state...
Read more >
Form behavior when "clicking off" to close a dialog
In this case it is wise to stick to conventions; clicking outside of a modal will act the same as the cancel option....
Read more >
5 Essential UX Rules for Dialog Design | by Nick Babich
A dialog should always open upon the user doing (or did) something on a page. That something might be clicking a button, following...
Read more >
Cancel vs Close: Design to Distinguish the Difference
Save changes before closing a view, use text labels rather than an X icon, and provide a confirmation dialog before destructive actions.
Read more >
Buttons on the web: placement and order
We will try to figure out where to better place them, and what order they… ... An action button, which initiates the dialog's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found