Git Product home page Git Product logo

Comments (1)

KoenCa avatar KoenCa commented on June 17, 2024

I'm in a situation were this is causing me some headaches. In my situation there are two disabled datepickers that represent a period and there are initial values coming from query params in the URL for both of them. There is also a props passed in from the parent that determines if they should be disabled or not. This prop is also reactively used in the min-date prop of the datepicker. So, because min-date is not reactive there is still an "old" min-date validation applied which is what this issue is about. So I tried to implement the workaround, but the problem is that this doesn't really work for disabled inputs. It looks like the disabled-days callback is only called when the input it is set on changes, but since it is disabled and gets an initial value it is triggered just after mount when the "old"/invalid min-date is still applied resulting in my form being invalid. I would think that it is at least rerun when I submit the form, but sadly this isn't the case. Otherwise it wouldn't be a problem I think. I have a reproduction based on your playground link to showcase that an invalid form can be submitted with your provided workaround.

https://formkit.link/75b2c4c96d5faa7c0d5c5cc7b147837f

First the end date is set and after that the start date is set. End date is earlier then the start date, but because the disabled-days callback is only executed when the input is changed the form can still be submitted. If it would also be executed on submit for a final check then it would result in an invalid form.

from formkit.

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.