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

Select doesen't work inside a Carousel List #2916

Closed
major-mayer opened this issue Sep 23, 2020 · 7 comments · Fixed by #2919
Closed

Select doesen't work inside a Carousel List #2916

major-mayer opened this issue Sep 23, 2020 · 7 comments · Fixed by #2919

Comments

@major-mayer
Copy link
Contributor

Overview of the problem

Buefy version: 0.9.3
Vuejs version: 2.6.12
OS/Browser: Firefox

Description

Steps to reproduce

  1. Add a b-select component inside the slot of a b-carousel list like this:
<template>
  <b-carousel-list :data="items">
    <template v-slot:item>
      <b-select v-model="model">
        <option>History</option>
        <option>Uploaded</option>
      </b-select>
    </template>
  </b-carousel-list>
</template>

<script>
export default {
  data() {
    return {
      items: [{ name: "test1" }, { name: "test2" }, { name: "test3" }],
      model: undefined,
    };
  },
};
</script>
  1. Click on the created select component

Expected behavior

The select dropdown menu opens

Actual behavior

Nothing happens. I don't know at which point the click/ change event is blocked, but it doesn't reach the select component.
Using a standard select tag shows the same problem.
Placing the b-select outside of the b-carousel-list slot works just fine.

@service-paradis
Copy link
Collaborator

I think @Tofandel fixed a similar issue for the Carousel component. Looks like the dragging events take priority over click events.

@major-mayer
Copy link
Contributor Author

Thanks for handling this.
I need to place the select element inside the carousel list, because i want to position it relative to the carousel slides.
So this bug is quite important for me, because i'm not aware of any workaround to archive this.

@Tofandel
Copy link
Contributor

Tofandel commented Sep 23, 2020

There is a bug with the piece of code, it only takes into account elements without text in them, I'll remove the condition

Tofandel added a commit to Tofandel/buefy that referenced this issue Sep 23, 2020
@Tofandel Tofandel mentioned this issue Sep 23, 2020
@major-mayer
Copy link
Contributor Author

Thanks for the quick fix, great work 🙂 👍

@major-mayer
Copy link
Contributor Author

major-mayer commented Nov 3, 2020

Hmm I just updated to Buefy 0.9.4 and at least for me this still doesn't work.
Could it be the case that the fix was only affecting the Carousel component and not the Carousel-List as described in my issue?

Anyway, I will use the Dropdown component instead of the select as a workaround for now, because this one seems to work even inside a Carousel List

@Tofandel
Copy link
Contributor

Tofandel commented Nov 3, 2020

@major-mayer Correct, the bug was on the carousel component, the carousel list doesn't support inner elements, the workaround would be to stop propagation of the mousedown event or to apply the same logic to both the carousel and carousel list

@alexd73
Copy link

alexd73 commented Mar 11, 2021

Adding @mousedown.native.stop was help me

      <b-select
        v-model="model"
        select
        aria-role="list"
        @mousedown.native.stop
      >

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

Successfully merging a pull request may close this issue.

5 participants