Skip to content

Commit 9c77537

Browse files
committed
Fix - Error on hide when popover is not shown
1 parent 3cc1d57 commit 9c77537

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "driver.js",
3-
"version": "0.9.3",
3+
"version": "0.9.4",
44
"description": "A light-weight, no-dependency, vanilla JavaScript library to drive the user's focus across the page",
55
"main": "dist/driver.min.js",
66
"types": "types/index.d.ts",

src/core/popover.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ export default class Popover extends Element {
9191
* @public
9292
*/
9393
hide() {
94+
// If hide is called when the node isn't created yet
95+
if (!this.node) {
96+
return;
97+
}
98+
9499
this.node.style.display = 'none';
95100
}
96101

src/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ export default class Driver {
145145
}
146146
}
147147

148-
149148
/**
150149
* Handler for the onResize DOM event
151150
* Makes sure highlighted element stays at valid position

0 commit comments

Comments
 (0)