Bug 599652

Summary: selecting a search suggestion via mouse click throws exception
Product: [Other] RHQ Project Reporter: Joseph Marques <jmarques>
Component: Core UIAssignee: Joseph Marques <jmarques>
Status: CLOSED CURRENTRELEASE QA Contact: Sunil Kondkar <skondkar>
Severity: medium Docs Contact:
Priority: low    
Version: 3.0.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-08-12 16:53:27 UTC 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 Joseph Marques 2010-06-03 17:14:56 UTC
Description of problem:

Although the search suggestion popup was implemented to work with the keyboard (use up/down to move between the items, press enter to select an item), it should be robust enough to work with mouse clicks as well (since we're not going to prevent the user from doing that).

How reproducible:

Every time.

Steps to Reproduce:
1. Go to resource browser
2. Enter "type=" into the SearchBar
3. Use the mouse and left-click one of the suggestions
  
Actual results:

User sees an ugly error message.

Expected results:

The clicked suggestion should help auto-complete the text in the SearchBar.

Comment 1 Joseph Marques 2010-06-03 18:46:39 UTC
commit ea38307cc914df400665f0af13a1fa3a1b200096
Author: Joseph Marques <joseph>
Date:   Thu Jun 3 14:42:26 2010 -0400

BZ-599652 / BZ-599687 - more robust support for keyboard/mouse events as applied to search suggestions

-----
    
BZ-599652 - prevent IndexOutOfBoundsException when mouse-clicking to select a search suggestion
* a mouse-click will move the focus off of the textbox
* an unfocused textbox has a cursor position of -1
* suggestion selection algorithm requires a valid cursor position
* fix is to manually manage the last known position of the cursor
    
BZ-599687 - support refreshing suggestions in more circumstances
* left-arrow/right-arrow in the textbox will show correct suggestions based on cursor position
* mouse-click events in the textbox will show correct suggestions based on cursor position

Comment 2 Sunil Kondkar 2010-06-07 11:51:45 UTC
Verified on 'jon-server-2.4.0.Beta1' build.

Selecting a search suggestion via mouse click selects the suggestion and auto-completes the text in search bar. 
(Ex: entered type= in searchbar and selected suggestion "Apache Virtual Host" via left click. The text is selected and displayed in searchbar.).

Comment 3 Corey Welton 2010-08-12 16:53:27 UTC
Mass-closure of verified bugs against JON.