Skip to content

Enter key on text inputs don't submit forms that use vue-simple-suggest #134

@dragospeta

Description

@dragospeta

I'm submitting a ...

  • bug report
  • feature request
  • support request

What is the current behavior?

I'm using the vue-simple-suggest component inside a form that has a @submit.prevent event on it. If i'm pressing the enter key on a random input from the form, the form doesn't submit. I tried to set the prevent-submit prop to false, it does fix the issue but it breaks other scenarios.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  1. Build a form that has a submit event on it
  2. Add a submit button
  3. Add a text input and a vue-simple-suggest component
  4. Press enter inside the text input

What is the expected behavior?

The form should submit.

How are you importing Vue-simple-suggest?

  • ESNext (original code, single-file .vue component, css included) (import VueSimpleSuggest from 'vue-simple-suggest/lib')
  • ES6 (import VueSimpleSuggest from 'vue-simple-suggest')
  • ES7 and above (import VueSimpleSuggest from 'vue-simple-suggest/dist/es7')
  • Bundled version (import VueSimpleSuggest from 'vue-simple-suggest')
  • CommonJS (const VueSimpleSuggest = require('vue-simple-suggest'))
  • UMD Component (<script type="text/javascript" src="https://unpkg.com/vue-simple-suggest"></script>)

What is the motivation / use case for changing the behavior?

This isn't a normal behaviour because the component breaks other basic functionalities.

Please tell us about your environment:

  • Vue.js Version: 2.5.13
  • Vue-simple-suggest version: 1.9.5
  • Browser: Chrome Version 76.0.3809.100 (Official Build) (64-bit)
  • Language: ES6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghacktoberfestThis issue is participating in hacktoberfesthelp wantedExtra attention is neededpatchThis is a thing to include in the next patch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions