Giter Site home page Giter Site logo

Comments (5)

AustinGil avatar AustinGil commented on July 27, 2024

That's an interesting question. Of course you can use v-model with multiple drawers, but that would open and close them at the same time. However, what I believe you are trying to do is toggle between different drawers. You should be able to do that as well but it's not automatically supported.

This component uses a custom prop for v-model called showing. Setting this to a truthy value should show the drawer, and falsey should hide it. With that in mind, you could pass some logic like <VDrawer :showing="activeDrawer === 1"> and another drawer with <VDrawer :showing="activeDrawer === 2">.

Then the other half of the v-model logic is the event. In this case, it's tied to the update event. So on the drawers you could do <VDrawer @update="toggleDrawers"> and add the toggleDrawers method to your component.

This isn't as simple as it could be because update is the only event that is triggered, and it's fired both when the drawer opens, and when it closes. It emits a boolean (true or false) so you might need to add some additional logic and parameters to that function.

I'm sorry I dont have a better answer, but I did just add an issue to add events for open and close. Hope this is helpful nonetheless.

from vuetensils.

lbineau avatar lbineau commented on July 27, 2024

Thanks for your quick reply.
The solution you proposed seems to work quite well, just an issue with the focus returning to the previous drawer toggle button. I can live with that for now.
I will have a look again when #113 gets implemented.

from vuetensils.

AustinGil avatar AustinGil commented on July 27, 2024

Ah yeah, that's a feature that is intended to assist with a11y. Yours was not a use-case I considered so I may need to think about it.

from vuetensils.

lbineau avatar lbineau commented on July 27, 2024

No I mean the accessible behavior is the reason I'm using your library, I totally get it should return to the trigger button when drawer is closed :-)
But when switching drawers the focus goes back on the trigger button of the previous drawer not the current one.
My usecase probably does not worth digging with your library, I'll think of something else no worries.

from vuetensils.

AustinGil avatar AustinGil commented on July 27, 2024

Yeah, you can try using refs to get the next focus target, and then you'll probably need to hook into $nextTick.

from vuetensils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.