Skip to content

Commit 48af379

Browse files
author
Niklas Kiefer
committed
feat(playground): configure editor#keyboard
1 parent 32532aa commit 48af379

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

packages/form-js-playground/src/Playground.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { PlaygroundRoot } from './components/PlaygroundRoot';
1111
* actions?: { display: Boolean }
1212
* container?: Element
1313
* data: any
14-
* editor?: { inlinePropertiesPanel: Boolean }
14+
* editor?: { inlinePropertiesPanel: Boolean, keyboard?: { bindTo: Element } }
1515
* exporter?: { name: String, version: String }
1616
* schema: any
1717
* } } FormPlaygroundOptions

packages/form-js-playground/src/components/PlaygroundRoot.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export function PlaygroundRoot(props) {
3535
} = actionsConfig;
3636

3737
const {
38-
inlinePropertiesPanel = true
38+
inlinePropertiesPanel = true,
39+
keyboard = {}
3940
} = editorConfig;
4041

4142
const paletteContainerRef = useRef();
@@ -107,7 +108,8 @@ export function PlaygroundRoot(props) {
107108
propertiesPanel: {
108109
parent: !inlinePropertiesPanel && propertiesPanelContainerRef.current
109110
},
110-
exporter: exporterConfig
111+
exporter: exporterConfig,
112+
keyboard
111113
});
112114

113115
paletteRef.current = formEditor.get('palette');

packages/form-js-playground/test/spec/Playground.spec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ describe('playground', function() {
8282
playground = new Playground({
8383
container,
8484
schema,
85-
data
85+
data,
86+
editor: {
87+
keyboard: { bindTo: document }
88+
}
8689
});
8790

8891
// then

0 commit comments

Comments
 (0)