Skip to content

Commit

Permalink
Fix eslint lints
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Robitaille <[email protected]>
  • Loading branch information
MarcelRobitaille committed Oct 14, 2022
1 parent fa7b6c8 commit 5c13db3
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/components/SimpleActionInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
</template>

<script>
import Vue from 'vue'
import ArrowRight from "icons/ArrowRight.vue"
const ActionGlobalMixin = {
before() {
// all actions requires a valid text content
Expand Down Expand Up @@ -72,14 +75,11 @@ const ActionGlobalMixin = {
},
}
const GenRandomId = (length) => {
return Math.random()
const GenRandomId = (length) =>
Math.random()
.toString(36)
.replace(/[^a-z]+/g, "")
.slice(0, length || 5)
}
import ArrowRight from "icons/ArrowRight"
export default {
name: "ActionInput",
Expand All @@ -96,7 +96,7 @@ export default {
*/
id: {
type: String,
default: () => "action-" + GenRandomId(),
default: () => `action-${GenRandomId()}`,
validator: (id) => id.trim() !== "",
},
/**
Expand Down Expand Up @@ -172,17 +172,19 @@ export default {
onSubmit(event) {
event.preventDefault()
event.stopPropagation()
if (!this.disabled) {
/**
* Emitted on submit of the input field
*
* @type {Event}
*/
this.$emit("submit", event)
} else {
// ignore submit
return false
return true
}
// ignore submit
return false
},
onChange(event) {
/**
Expand Down

0 comments on commit 5c13db3

Please sign in to comment.