diff --git a/docs-kr/network/interaction.html b/docs-kr/network/interaction.html
index 36b5ba45d4..c539c31447 100644
--- a/docs-kr/network/interaction.html
+++ b/docs-kr/network/interaction.html
@@ -156,7 +156,8 @@
옵션
keyboard: {
enabled: false,
speed: {x: 10, y: 10, zoom: 0.02},
- bindToWindow: true
+ bindToWindow: true,
+ autoFocus: true,
},
multiselect: false,
navigationButtons: false,
diff --git a/docs/network/interaction.html b/docs/network/interaction.html
index 42de4bb7c0..a93551b0ef 100644
--- a/docs/network/interaction.html
+++ b/docs/network/interaction.html
@@ -156,7 +156,8 @@ Options
keyboard: {
enabled: false,
speed: {x: 10, y: 10, zoom: 0.02},
- bindToWindow: true
+ bindToWindow: true,
+ autoFocus: true,
},
multiselect: false,
navigationButtons: false,
@@ -317,6 +318,15 @@ Options
keyboard shortcuts only work on the network that has the focus.
+
+ keyboard.autoFocus |
+ Boolean |
+ true |
+
+ When keyboard.bindToWindow=false this option allows you
+ to skip auto focusing the network on hover.
+ |
+
multiselect |
Boolean |
diff --git a/lib/network/modules/InteractionHandler.js b/lib/network/modules/InteractionHandler.js
index 9641080d05..7cc8a1ed05 100644
--- a/lib/network/modules/InteractionHandler.js
+++ b/lib/network/modules/InteractionHandler.js
@@ -55,6 +55,7 @@ class InteractionHandler {
enabled: false,
speed: { x: 10, y: 10, zoom: 0.02 },
bindToWindow: true,
+ autoFocus: true,
},
navigationButtons: false,
tooltipDelay: 300,
@@ -647,6 +648,7 @@ class InteractionHandler {
// if we bind the keyboard to the div, we have to highlight it to use it. This highlights it on mouse over.
if (
+ this.options.keyboard.autoFocus &&
this.options.keyboard.bindToWindow === false &&
this.options.keyboard.enabled === true
) {
diff --git a/lib/network/options.ts b/lib/network/options.ts
index 7347e90879..6c85e3e338 100644
--- a/lib/network/options.ts
+++ b/lib/network/options.ts
@@ -420,6 +420,7 @@ const allOptions: OptionsConfig = {
__type__: { object },
},
bindToWindow: { boolean: bool },
+ autoFocus: { boolean: bool },
__type__: { object, boolean: bool },
},
multiselect: { boolean: bool },
@@ -759,6 +760,7 @@ const configureOptions: ConfiguratorConfig = {
zoom: [0.02, 0, 0.1, 0.005],
},
bindToWindow: true,
+ autoFocus: true,
},
multiselect: false,
navigationButtons: false,