Bladeren bron

Landing plugin focus bugfix.

Afshin Darian 8 jaren geleden
bovenliggende
commit
bdafdae86d
2 gewijzigde bestanden met toevoegingen van 13 en 0 verwijderingen
  1. 1 0
      src/landing/index.css
  2. 12 0
      src/landing/plugin.ts

+ 1 - 0
src/landing/index.css

@@ -5,6 +5,7 @@
 
 
 .jp-Landing {
+  outline: none;
   position: absolute;
   display: flex;
   flex-direction: column;

+ 12 - 0
src/landing/plugin.ts

@@ -1,6 +1,10 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
+import {
+  Message
+} from 'phosphor/lib/core/messaging';
+
 import {
   h, VNode
 } from 'phosphor/lib/ui/vdom';
@@ -176,6 +180,14 @@ class LandingWidget extends VDomWidget<LandingModel> {
     this._app = app;
   }
 
+  /**
+   * Handle `'activate-request'` messages.
+   */
+  protected onActivateRequest(msg: Message): void {
+    this.node.tabIndex = -1;
+    this.node.focus();
+  }
+
   /**
    * Render the landing plugin to virtual DOM nodes.
    */