Skip to content

Commit

Permalink
fix(ui): driver function snippets select not working
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Jun 6, 2023
1 parent 300fb2e commit 80be583
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/components/Confirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
:items="input.items"
:rules="inputProps[input.key].rules"
:label="input.label"
@change="input.onChange || (() => {})"
@change="
inputProps[input.key].onChange($event)
"
:persistent-hint="!!input.hint"
:multiple="!!input.multiple"
:hint="input.hint"
Expand All @@ -107,7 +109,9 @@
:items="input.items"
:rules="inputProps[input.key].rules"
:label="input.label"
@change="input.onChange || (() => {})"
@change="
inputProps[input.key].onChange($event)
"
:persistent-hint="!!input.hint"
:multiple="!!input.multiple"
:hint="input.hint"
Expand Down Expand Up @@ -167,7 +171,7 @@
</v-container>
<v-container v-if="input.type === 'button'">
<v-btn
@click="input.onChange"
@click="inputProps[input.key].onChange"
:color="input.color"
:outlined="input.outlined"
>
Expand Down Expand Up @@ -224,7 +228,7 @@ import { highlight, languages } from 'prismjs/components/prism-core'
import 'prismjs/components/prism-clike'
import 'prismjs/components/prism-javascript'
import 'prismjs/themes/prism-tomorrow.css'
import { wrapFunc } from '../lib/utils'
import { wrapFunc, noop } from '../lib/utils'
import ListInput from './custom/ListInput.vue'
export default {
Expand Down Expand Up @@ -268,6 +272,7 @@ export default {
},
},
methods: {
noop,
paintBoundingBox(detectedCodes, ctx) {
for (const detectedCode of detectedCodes) {
const {
Expand Down Expand Up @@ -330,7 +335,10 @@ export default {
input.onChange &&
typeof input.onChange === 'function'
) {
input.onChange = input.onChange.bind(this, this.values)
this.inputProps[input.key].onChange =
input.onChange.bind(this, this.values)
} else {
this.inputProps[input.key].onChange = noop
}
if (input.rules) {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ export function copy(o) {
return JSON.parse(JSON.stringify(o))
}

export function noop() {}

export function wait(ms) {
return new Promise((r) => setTimeout(r, ms))
}
Expand Down

0 comments on commit 80be583

Please sign in to comment.