Skip to content

Commit 7fec97a

Browse files
finetjuljourdain
authored andcommitted
fix(events): prevent VTK.js from eating keyboard events
See Kitware/vtk-js#3239 preventDefault() must be removed because it was preventing the render window HTML element from getting the focus on mouse click. draggable="false" must be added otherwise mouse drags attempt to "drag" the rendered <img> Issue could be reproduced by adding the following in a trame-rca VTK example: ``` with layout.toolbar: v3.VTextField(v_model="test",) ```
1 parent cc61dcd commit 7fec97a

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

vue-components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"vue": "^2.7.0 || >=3.0.0"
77
},
88
"dependencies": {
9-
"@kitware/vtk.js": "28.10.1"
9+
"@kitware/vtk.js": "^34.16.0"
1010
},
1111
"scripts": {
1212
"build": "vite build --emptyOutDir",

vue-components/src/components/ImageDisplayArea.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,5 +117,5 @@ export default {
117117
this.cleanup();
118118
},
119119
inject: ['trame'],
120-
template: `<img :style="imageStyle" :src="displayURL" v-show="hasContent" />`,
120+
template: `<img :style="imageStyle" :src="displayURL" v-show="hasContent" draggable="false" />`,
121121
};

vue-components/src/components/RemoteControlledArea.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export default {
5858
// VTK input handling
5959
// -----------------------------------------------------------------------
6060
function _getScreenEventPositionFor(source) {
61-
source.preventDefault(); // Do we need that?
6261
return {
6362
x: source.clientX - currentOffset[0],
6463
y: currentSizeUpdateEvent.h - source.clientY + currentOffset[1],

0 commit comments

Comments
 (0)