Bug 2219332

Summary: Prevent accidentally submitting ticket from "user select" widget
Product: [Community] Bugzilla Reporter: Vít Ondruch <vondruch>
Component: User InterfaceAssignee: Bug Bot 🤖 <bugbot>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.0CC: agk, jfearn
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2187633 Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Vít Ondruch 2023-07-03 09:00:07 UTC
I am extracting one specific issue from Bug #2187633

--- Additional comment from Jeff Fearn 🐞 on 2023-07-03 01:25:25 CEST ---

(In reply to Vít Ondruch from comment #5)
> I am testing in the staging instance and while the behavior is probably
> improved, I still struggle submitting the changes unexpectedly (and the
> results might be visible in bug #1995819). The reproducer should be:
> 
> 1) Start typing a comment by `@` character
> 2) The focus is moved into the search box
> 3) Start to type `pval` (I hope that my colleague Pavel Valena would be
> forgiving, should this result in some needinfos for him ;))
> 4) Press `Enter`
> 
> IMHO, the `Enter` in the search box cannot submit the changes of the ticket
> no matter what.

It looks like if you use that widget, anywhere, such as CC, and you hit enter without selecting an entry in the drop down then it submits the form. This is actually correct from accessibility standards perspective, but it sucks. We would need to change how the text box works for this use case, but do so in a way that doesn't break accessibility.

i.e. we will need to work out how to make it non-standard and communicate that to browsers in accessibility mode, readers, etc.

In the meantime if you decide you don't want to select a user, then use the escape key to exit the widget.

Comment 1 Vít Ondruch 2023-07-03 09:05:37 UTC
(In reply to Vít Ondruch from comment #0)
> It looks like if you use that widget, anywhere, such as CC, and you hit
> enter without selecting an entry in the drop down then it submits the form.
> This is actually correct from accessibility standards perspective, but it
> sucks. We would need to change how the text box works for this use case, but
> do so in a way that doesn't break accessibility.

Not sure if in the form has to be existing user but checking existence of valid user might be one precondition to consider what the Enter should do in that box.

Also, I think it is kind of surprising that typing part of the user name does not preselect some of the listed users.

> i.e. we will need to work out how to make it non-standard and communicate
> that to browsers in accessibility mode, readers, etc.
> 
> In the meantime if you decide you don't want to select a user, then use the
> escape key to exit the widget.

I don't think that my issue is with escaping the widget. But if I type "pval" looking for Pavel Valena, then some entry from the displayed list should be preselected and should handle the press of the Enter. But to have something selected, I would need to press an arrow first.

Comment 2 Jeff Fearn 🐞 2023-07-04 01:02:24 UTC
FYI for future me, the widget the user select is based on [1, the overrides in RHBZ [2].

1: https://api.jqueryui.com/autocomplete/
2: https://pagure.io/Red-Hat-Bugzilla/rh-bugzilla/blob/master/f/extensions/BayotBase/web/js/bayot.util.js#_971