Code Monkey home page Code Monkey logo

Comments (3)

airblade avatar airblade commented on May 27, 2024

I've been following the WAI-ARIA date picker dialog design pattern, and I understand it to mean the calendar should show and hide based on clicking (or the keyboard equivalent) the toggle button.

Having said that, I just re-read the pattern and it doesn't really specify one way or the other. I think it used to but they seem to have updated it since I built the datepicker. Their example code still requires clicking a toggle button.

Anyway, you could listen for the text field's focus event and then trigger a click event on the toggle element. Either with plain JavaScript or a tiny Stimulus controller of your own.

from stimulus-datepicker.

hmontazeri avatar hmontazeri commented on May 27, 2024

you actually can't bc the click event trigger on toggle will close the datepicker again 😢 just tried 😃. It basically opens and closes.

from stimulus-datepicker.

airblade avatar airblade commented on May 27, 2024

Thanks @hmontazeri. I'm going to close this because I don't think the calendar should behave this way by default, and it's straightforward to handle the event if you really want to.

from stimulus-datepicker.

Related Issues (19)

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.