Bug 1277906 - part1: change HTMLTooltip default autofocus value to false;r=bgrins draft
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 03 Jun 2016 21:15:54 +0200
changeset 375334 626c5812f1602a257a1065a842d3f025f85452aa
parent 375309 ab5e81678aaae8da42e11e8daf118e2a9c90baac
child 375335 aec5a5b10c5adfcdf7941c2edad83cdee55cd06a
push id20239
push userjdescottes@mozilla.com
push dateFri, 03 Jun 2016 22:42:21 +0000
reviewersbgrins
bugs1277906
milestone49.0a1
Bug 1277906 - part1: change HTMLTooltip default autofocus value to false;r=bgrins Given the current usage of the HTMLTooltip, I think having the autofocus as an opt-in behavior makes more sense. MozReview-Commit-ID: CS98szSKQdF
devtools/client/shared/widgets/HTMLTooltip.js
--- a/devtools/client/shared/widgets/HTMLTooltip.js
+++ b/devtools/client/shared/widgets/HTMLTooltip.js
@@ -49,23 +49,23 @@ const EXTRA_BORDER = {
  * The HTMLTooltip can display HTML content in a tooltip popup.
  *
  * @param {Toolbox} toolbox
  *        The devtools toolbox, needed to get the devtools main window.
  * @param {Object}
  *        - {String} type
  *          Display type of the tooltip. Possible values: "normal", "arrow"
  *        - {Boolean} autofocus
- *          Defaults to true. Should the tooltip be focused when opening it.
+ *          Defaults to false. Should the tooltip be focused when opening it.
  *        - {Boolean} consumeOutsideClicks
  *          Defaults to true. The tooltip is closed when clicking outside.
  *          Should this event be stopped and consumed or not.
  */
 function HTMLTooltip(toolbox,
-  {type = "normal", autofocus = true, consumeOutsideClicks = true} = {}) {
+  {type = "normal", autofocus = false, consumeOutsideClicks = true} = {}) {
   EventEmitter.decorate(this);
 
   this.doc = toolbox.doc;
   this.type = type;
   this.autofocus = autofocus;
   this.consumeOutsideClicks = consumeOutsideClicks;
 
   // Use the topmost window to listen for click events to close the tooltip