0

I created a custom Nova Field to autocomplete addresses via Google Place API.

When I select the suggested address from autocomplete dropdown and press 'Enter' key, the resource Create form is getting submitted.

Is there any way to prevent keypress event going up after address input field received the event in Vue.js component or from Nova side, to prevent the form from getting submitted?

1 Answer 1

1

Found the solution

Just have to put @keypress.enter.prevent in input tag

            <input
                    :id="field.name"
                    type="text"
                    class="w-full form-control form-input form-input-bordered"
                    :class="errorClasses"
                    :placeholder="field.name"
                    v-model="value"
                    @keypress.enter.prevent
            />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.