Git Product home page Git Product logo

Comments (4)

rozsazoltan avatar rozsazoltan commented on September 26, 2024 2

Wow, that's a completely valid observation! A real issue that needs to be addressed.

from v-onboarding.

chriskulwik avatar chriskulwik commented on September 26, 2024

I was able to get around this.

Issue 1 workaround:

add this to every step

on: {
      beforeStep: () => onBeforeStep(),
      afterStep: () => onAfterStep(),
    },

onBeforeStep and onAfterStep are defined as such:

const onBeforeStep = () => {
  document.addEventListener('keydown', keydownHandler);
};

const onAfterStep = () => {
  document.removeEventListener('keydown', keydownHandler);
};

keydownHandler is defined as such:

const keydownHandler = (event: KeyboardEvent) => {
  if (event.key === 'Tab') {
    /*  If you hit tab, the close button will be focused instead of the primary. This is bc the keydown event is
     *  processed first (primary btn is focused), then the browser normally handles the tab press, thus ending on
     *  the close button. */
    const primaryBtn = document.querySelector('button.v-onboarding-btn-primary');
    // @ts-ignore this is ok, focus on primary button if it exists
    primaryBtn?.focus();
    document.removeEventListener('keydown', keydownHandler);
  }
};

Issue 2 workaround:

wrap VOnboardingWrapper in a the FocusLoop component from vue-a11y

<FocusLoop>
   <VOnboardingWrapper ref="wrapper" :steps="steps" :options="options" />
 </FocusLoop>

and a visual accessibility fix, to see which button has focus:

.v-onboarding-item {

  button:focus {
    outline-color: black;
  }
}

If this changes look good, and you think they'd be compatible with the code base, I'm happy to make a fork and work on integrating these changes.

from v-onboarding.

fatihsolhan avatar fatihsolhan commented on September 26, 2024

Hi all! Thank you for you interest and potential suggestions for this issue, I appreciate it. I've implemented a focus-trap feature and it should be live soon

from v-onboarding.

github-actions avatar github-actions commented on September 26, 2024

🎉 This issue has been resolved in version 2.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

from v-onboarding.

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.