Skip to content
\">
<template>\n  <flow-form\n    ref=\"flowform\"\n    v-bind:questions=\"questions\"\n    v-bind:standalone=\"true\"\n  >\n  flow-form>\ntemplate>\n\n<script>\n  export default {\n    name: 'example',\n\n    components: {\n      FlowForm\n    },\n\n    data() {\n      return {\n        questions: [\n          ...\n        ]\n      }\n    },\n    mounted() {\n      document.addEventListener('keyup', this.onKeyUpListener, true)\n    },\n\n    beforeUnmount() {\n      document.removeEventListener('keyup', this.onKeyUpListener, true)\n    },\n\n    methods: {\n      onKeyUpListener(e) {\n        if (e.key === 'ArrowDown') {\n          this.$refs.flowform.goToNextQuestion()\n        } else if (e.key === 'ArrowUp') {\n          this.$refs.flowform.goToPreviousQuestion()\n        }\n      }\n    }\n  }\nscript>
\n

We'll also add this internally as well with a configurable option in a future update.

","upvoteCount":1,"url":"https://github.com/ditdot-dev/vue-flow-form/discussions/193#discussioncomment-951480"}}}

Keyboard (arrows) navigation for answers #193

Answered by spinn
Miguelklappes asked this question in Ideas
Discussion options

You must be logged in to vote

@Miguelklappes Although Flow Form doesn't implement this natively, we added a few new API functions which would allow you to do this manually/externally:

">
<template>
  <flow-form
    ref="flowform"
    v-bind:questions="questions"
    v-bind:standalone="true"
  >
  flow-form>
template>

<script>
  export default {
    name: 'example',

    components: {
      FlowForm
    },

    data() {
      return {
        questions: [
          ...
        ]
      }
    },
    mounted() {
      document.addEventListener('keyup', this.onKeyUpListener, true)
    },

    beforeUnmount() {
      document.removeEventListener('keyup', this.onKeyUpListener, true)
    },

    methods: {
      onKeyUpList…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Miguelklappes
Comment options

Answer selected by EkaterinaVu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants