Skip to content

Commit f30dbf7

Browse files
author
Niklas Kiefer
committed
feat(playground): configure editor#keyboard
1 parent f567b62 commit f30dbf7

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
@@ -81,7 +81,10 @@ describe('playground', function() {
8181
playground = new Playground({
8282
container,
8383
schema,
84-
data
84+
data,
85+
editor: {
86+
keyboard: { bindTo: document }
87+
}
8588
});
8689

8790
// then

0 commit comments

Comments
 (0)