jean-emmanuel / open-stage-control

Libre and modular OSC / MIDI controller
https://openstagecontrol.ammd.net
GNU General Public License v3.0
702 stars 88 forks source link

[Bug] Day to day Editing bug #761

Closed Sakamacheee closed 2 years ago

Sakamacheee commented 2 years ago

Hello jean-emmanuel,

Here's one "editing bug" i just had right now : in the script field of a button's widget, i had selected part of the text, then CTRL-X, then RETURN to get out, and wooosh... got some trouble... well as i'm writing this, i'm sorry cause i don't really remember all the steps, as i went here really fast... got some trouble with CTRL+V after that...

Here's the console log (is that how it's called ?)

Error while setting script to: "JS{\nvar props = {}\nprops.colorWidget = \"rgb(0,200,0)\"\nprops.script = \"console.log(this)\"\nreturn props\n}\n\n".
It's probably a bug, please open a new bug ticket with the followigin informations athttps://github.com/jean-emmanuel/open-stage-control/issues
Uncaught TypeError: this.getProp(...).includes is not a function
at constructor (src/client/widgets/basics/button.js:67:56)
at this.getIterator (src/client/parser.js:77:21)
at w.scroll (src/client/editor/data-workers.js:104:27)
at this.inspector.on('update', (src/client/editor/index.js:48:36)
at this._listeners[evt].slice (src/client/events/event-emitter.js:29:29)
at JSON.parseFlex (src/client/ui/ui-inspector.js:214:13)
at dispatchEvent (src/client/dom.js:32:16)
at onKeydown (src/client/ui/ui-inspector.js:231:20)
jean-emmanuel commented 2 years ago

Hi, the error is due to a lack of verification on the button's side, I'll fix it. That being said, there's very little chance you really want to write that in the script property.

Sakamacheee commented 2 years ago

Ok thank you.

You just can't imagine what i try to write in the script property... it's a bit funky, you know... See a teen's room ? It's worse :-D