Bypass the rendering pipeline for highlighting to reduce (eliminate) latency

Fixes #15
This commit is contained in:
Ian Gulliver
2019-07-14 02:26:00 +00:00
parent a4630ba92a
commit f3823812c7
18 changed files with 96 additions and 123 deletions

View File

@@ -9,25 +9,13 @@ class EditorLabel extends EditorInputBase {
serialize() {
return super.serialize({
type: 'label',
id: this.getId(),
});
}
onKeyDown(e) {
super.onKeyDown(e);
switch (e.key) {
case ' ':
// We don't support highlighting, but stop propagation
e.stopPropagation();
e.preventDefault();
break;
}
}
static unserialize(ser) {
let label = new EditorLabel(ser.id);
label.setLabel(ser.label);
label.setHighlight(ser.highlight);
return label.getElement();
}
}