Code Monkey home page Code Monkey logo

Comments (6)

KittyGiraudel avatar KittyGiraudel commented on May 26, 2024 1

Hey there.

I can’t speak for vue-a11y-dialog, but the way it works on react-a11y-dialog is that it renders the dialogs in a separate container from the app root through a React portal. Therefore these containers’ aria-hidden can safely be toggled: one is hidden, not the other.

<Dialog appRoot='#app-root' dialogRoot='#dialog-root' {...otherConfigProps} />
<div id="app-root" />
<div id="dialog-root" />

from vue-a11y-dialog.

marcus-herrmann avatar marcus-herrmann commented on May 26, 2024

"#app" is in Vue's documentation and examples very often the overall wrapping container, so even when you are using PortalVue (see my blog post above) the following open modal would render the whole app inert:

<div id="app">
    <div id="wrapper">
          <portal to="modals">
                <a11y-dialog app-root="#app">
                <!-- ... -->
                </a11y-dialog>
         </portal>
    </div>
    <portal-target name="modals"></portal-target>
</div>

from vue-a11y-dialog.

morkro avatar morkro commented on May 26, 2024

@hugogiraudel Thanks for the explanation! 🎉

I think we can still achieve the same effect with PortalVue, there is some documentation for rendering a portal outside of a Vue application. I'll do some prototyping with it and see if that works :)

from vue-a11y-dialog.

morkro avatar morkro commented on May 26, 2024

Just some updates here. I did some prototyping and generally this seems to work. However, the API (targetEl) to render a portal outside of a Vue application comes with its own issues making this as of now not ready to be implemented without major workarounds.

The library author is aware of these issues and plans to rework the API with the next release for PortalVue. I don't know when that is scheduled though.

I will follow the development of PortalVue and consider releasing a new version of vue-a11y-dialog with some workarounds to at least address the accessibility issues.

from vue-a11y-dialog.

morkro avatar morkro commented on May 26, 2024

For reference: LinusBorg/portal-vue#164

from vue-a11y-dialog.

morkro avatar morkro commented on May 26, 2024

I've just published a fix for this :)

from vue-a11y-dialog.

Related Issues (16)

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.