Red Hat Bugzilla – Bug 599687
repositioning the cursor in the SearchBar does not refresh suggestions
Last modified: 2010-08-12 12:47:01 EDT
Description of problem:
The SearchBar suggestions should be refreshed if the user hits left-arrow or right-arrow, or if the user left-clicks the cursor to a different position.
Steps to Reproduce:
1. go to the inventory browser
2. enter "type=cpu category=server"
3. using the mouse or left-arrow/right-arrow keys, reposition the cursor somewhere in the middle of the text
the suggestions do not refresh
the search suggestion popup should refresh itself with entries that are relevant to the cursor position. in other words, if @@@ represents where the cursor is, and the user positioned the cursor after the "type=" expression above, it would give you "type=@@@cpu category=server"
from here, the user should be given suggestions based off of the available types in the system (in other words, it should be treated as if the use had entered "type="
furthermore, when the user selects a suggestion from the drop-down, the "cpu" portion should be replaced with the selection.
Author: Joseph Marques <firstname.lastname@example.org>
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
Verified on 'jon-server-2.4.0.Beta1' build.
Using the mouse or left-arrow/right-arrow keys, repositioning the cursor displays available suggestions and selecting the suggestion replaces with the selection.
(Ex: when user repositions the cursor after type= in expression "type=cpu category=server" , it displays available types and if user selects a type such as 'Apache HTTP Server', the suggestion gets selected.
Mass-closure of verified bugs against JON.