kamrify commited on
Commit
9c77537
·
1 Parent(s): 3cc1d57

Fix - Error on hide when popover is not shown

Browse files
Files changed (3) hide show
  1. package.json +1 -1
  2. src/core/popover.js +5 -0
  3. src/index.js +0 -1
package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "driver.js",
3
- "version": "0.9.3",
4
  "description": "A light-weight, no-dependency, vanilla JavaScript library to drive the user's focus across the page",
5
  "main": "dist/driver.min.js",
6
  "types": "types/index.d.ts",
 
1
  {
2
  "name": "driver.js",
3
+ "version": "0.9.4",
4
  "description": "A light-weight, no-dependency, vanilla JavaScript library to drive the user's focus across the page",
5
  "main": "dist/driver.min.js",
6
  "types": "types/index.d.ts",
src/core/popover.js CHANGED
@@ -91,6 +91,11 @@ export default class Popover extends Element {
91
  * @public
92
  */
93
  hide() {
 
 
 
 
 
94
  this.node.style.display = 'none';
95
  }
96
 
 
91
  * @public
92
  */
93
  hide() {
94
+ // If hide is called when the node isn't created yet
95
+ if (!this.node) {
96
+ return;
97
+ }
98
+
99
  this.node.style.display = 'none';
100
  }
101
 
src/index.js CHANGED
@@ -145,7 +145,6 @@ export default class Driver {
145
  }
146
  }
147
 
148
-
149
  /**
150
  * Handler for the onResize DOM event
151
  * Makes sure highlighted element stays at valid position
 
145
  }
146
  }
147
 
 
148
  /**
149
  * Handler for the onResize DOM event
150
  * Makes sure highlighted element stays at valid position