Artur Arseniev
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
10 additions and
2 deletions
-
src/canvas/index.js
-
src/canvas/view/CanvasView.js
|
|
|
@ -552,8 +552,12 @@ export default () => { |
|
|
|
*/ |
|
|
|
isInputFocused() { |
|
|
|
const doc = this.getDocument(); |
|
|
|
const frame = this.getFrameEl(); |
|
|
|
const toIgnore = ['body', ...this.getConfig().notTextable]; |
|
|
|
const focused = doc && doc.activeElement; |
|
|
|
const docActive = frame && document.activeElement === frame; |
|
|
|
const focused = docActive |
|
|
|
? doc && doc.activeElement |
|
|
|
: document.activeElement; |
|
|
|
|
|
|
|
return focused && !toIgnore.some(item => focused.matches(item)); |
|
|
|
}, |
|
|
|
|
|
|
|
@ -92,7 +92,11 @@ export default Backbone.View.extend({ |
|
|
|
const { em } = this; |
|
|
|
const key = getKeyChar(ev); |
|
|
|
|
|
|
|
if (key === ' ' && em.getZoomDecimal() !== 1) { |
|
|
|
if ( |
|
|
|
key === ' ' && |
|
|
|
em.getZoomDecimal() !== 1 && |
|
|
|
!em.get('Canvas').isInputFocused() |
|
|
|
) { |
|
|
|
this.preventDefault(ev); |
|
|
|
em.get('Editor').runCommand('core:canvas-move'); |
|
|
|
} |
|
|
|
|