Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect to selected path #16

Open
smokeyfro opened this issue Sep 26, 2019 · 1 comment
Open

Redirect to selected path #16

smokeyfro opened this issue Sep 26, 2019 · 1 comment

Comments

@smokeyfro
Copy link

Hi Romain,

I'm trying to implement your search plugin and have got the list from my GraphQL edges and the selection working, but I'm having a hard time figuring out how to submit the form on selection. I'm using Gridsome for the site and tried adding a method that uses route.push, but not having much luck. Any ideas?

I added a simplified version of my code here:
https://gist.github.com/smokeyfro/ddd97bac76fafac1a9c90f5c0c744bac

TIA,
Chris

@DeVoresyah
Copy link
Contributor

Hi, Chris
I've checked your gist, have you try to use <form> instead of div?

<form class="relative" @submit.prevent="submit">
        <Dropdown
            :options="$page.places.edges.map(e => e.node)"
            v-on:selected="submit"
            :disabled="false"
            name="dropdown"
            :maxItem="600"
            class="text-left"
            placeholder="Please select an option">
        </Dropdown>
        <button type="submit" class="relative z-50">Go</button>
    </div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants