neos-ui icon indicating copy to clipboard operation
neos-ui copied to clipboard

BUG: Creation dialog cannot be closed after validation threw an error

Open lorenzulrich opened this issue 1 year ago • 5 comments

Description

In a creation dialog with properties that have a validator, such as a NotEmpty validator, the dialog cannot be closed as soon as validation threw any kind of error.

Steps to Reproduce

  1. Configure a node type to have at least two fields in the creation dialog, at least one of them with a NotEmpty validator.
  2. Open the creation dialog. Fill in the non-mandatory field and press tab to trigger validation on the mandatory one. You now see the red validation error.
  3. Try using the "Back" button to close the creation dialog.

image

Expected behavior

The creation dialog closes.

Actual behavior

The creation dialog stays open and cannot be escaped unless you reload the whole UI.

Affected Versions

Neos: 7.3+ UI: 7.3+

lorenzulrich avatar Dec 28 '23 08:12 lorenzulrich

Uuuups well ... Thanks ... Seems to be related or caused by https://github.com/neos/neos-ui/pull/3579

mhsdesign avatar Jan 12 '24 18:01 mhsdesign

https://github.com/neos/neos-ui/assets/85400359/d0702036-191a-41ef-aaf9-16db5c87a458

Hmm i cannot reproduce this and would be also confused as i remember having tested that ^^

Could you please send a video as well and control the console log ;)

mhsdesign avatar Jan 12 '24 19:01 mhsdesign

I guess @lorenzulrich wanted to close the dialog via ESC and that is not possible. But you are right, you can go a step back and close the dialog.

markusguenther avatar Jan 24 '24 16:01 markusguenther

Exactly that was the purpose of https://github.com/neos/neos-ui/pull/3579. Especially it should not be possible to fat finger click outside and all the stuff is obliterated.

Anke already critized that escape will not force exit, or rather open an are you sure dialog:

https://github.com/neos/neos-ui/issues/3582

But i found adding yet another dialog on top of the dialog with: Do you really want to discard your pending node creation changes a bit overkill.

Thats why esc will just trigger the shake animation.

Also @lorenzulrich explicitly mentioned that the back button does not work (point 3) so i think we can close this issue as invalid?

mhsdesign avatar Jan 24 '24 19:01 mhsdesign

I need to clarify that only happens when there is no "node type selector", in my exact case using https://github.com/psmb/Psmb.FlatNav with the newNodeType option.

In this case, the creation dialog is opened without opening the node type selector first (obviously).

Then you cannot use the back button (even if validation doesn't fail), but you can still click anywhere outside the modal to close the creation dialog.

As soon as any validator failed, neither of this works, so you cannot escape the modal in any way.

I'm not sure this is something to solve in FlatNav or in the Neos UI. If this didn't clarify the problem, I will record a video.

lorenzulrich avatar Jan 24 '24 22:01 lorenzulrich