input: disable focus when not editable

This commit is contained in:
jean-emmanuel 2017-10-06 09:06:06 +02:00
parent af99fcae80
commit 608f1b1311
2 changed files with 4 additions and 4 deletions

View file

@ -5,10 +5,10 @@
- main
- renamed `--sync` option to `--send` (deprecation, backward-compatible)
- osc
- messages received almost simultaneously are now bundled before being sent to the clients. This helps preserving their order.
- messages received almost simultaneously are now bundled before being sent to clients. This helps preserving their order.
- widgets
- sliders/pads: when receiving feedback while touched, the widget waits to be released before updating to the latest received value.
- input: the widget's value is no longer validated when leaving focus by clicking somewhere else or hitting the `Tab` key (it must be submitted by hitting the `Enter` key); when submitting a value to another widget, the feedback from this widget doesn't trigger a second osc message anymore
- input: the widget's value is no longer validated when leaving focus by clicking somewhere else or hitting the `Tab` key (it must be submitted by hitting the `Enter` key); when submitting a value to another widget, the feedback from this widget doesn't trigger a second osc message anymore; non-editable inputs can't steal focus anymore
- added support for `null` value in `target` option to disable osc sending
- misc
- property fields are now parsed using [JSON5](https://github.com/json5/json5), a more flexible notation. Session files are still written in standard JSON format, this is just a way to avoid typing mistakes when using the editor.

View file

@ -46,7 +46,7 @@ module.exports = class Input extends _canvas_base {
var html = `
<div class="input">
<canvas tabindex="0"></canvas>
<canvas></canvas>
</div>
`
@ -56,7 +56,7 @@ module.exports = class Input extends _canvas_base {
this.stringValue = ''
if (this.getProp('editable')) {
this.canvas.attr('tabindex', 0)
this.canvas.on('focus', this.focus.bind(this))
this.input = $('<input></input>')