dasmoth / dalliance

Interactive web-based genome browser.
http://www.biodalliance.org/
BSD 2-Clause "Simplified" License
227 stars 68 forks source link

Bug? After selecting menu item, browser object loses focus #32

Closed timjph closed 11 years ago

timjph commented 11 years ago

After clicking on a menu item, need to click on track label again to reactivate browser. Bug? Would seem more natural to automatically restore selected track after selected menu item is cleared.

dasmoth commented 11 years ago

Somewhat complex.

Old versions of Dalliance aggressively captured key presses without really interacting with the browser (or OS) notion of input focus. This could cause problems if there was anything else on the page which required keyboard interaction!

Since 0.8, we only capture keyboard interface when part of the Dalliance interface has focus. This is tied in with the new tier selection system (and NB that when you scroll off the top of the track list, focus is given to the location-bar -- again, using the standard focus mechanism).

So I think the actual issue here is that when the browser component legitimately loses focus, the selected tier retains its "blue outline" highlighting.

Suggested solution:

     - When focus is lost (detected via onblur handlers), the currently selected tier switches to a different highlighting style (thick *gray* border seems logical?).

     - Clicking in main browser area when Dalliance doesn't have the input focus causes it to be refocussed (maintaining current tier selection)

     - Clicking on a tier tab gains focus and selects that tier (as currently).

Sound reasonable?

dasmoth commented 11 years ago

Should be fixed now.

It's also clearer when Dalliance does/doesn't have focus.