GithubHelp home page GithubHelp logo

Comments (7)

justin-schroeder avatar justin-schroeder commented on June 25, 2024

Yeah I dont think we should not process the -class prop — too many valid use cases would be impossible. Instead I think we might have 3 options:

  1. Make an exception for $reset, don’t treat it like a variable
  2. Educate people to use the __raw__inputClass prefix
  3. Come up with a new token other than the dollar-prefixed $reset

from formkit.

andrew-boyd avatar andrew-boyd commented on June 25, 2024

Honestly, 3 seems like the most sensible thing, and now's the time to do it. some options:

%reset
_reset
!reset
@reset <-- this one feels sass / tailwind like.

from formkit.

justin-schroeder avatar justin-schroeder commented on June 25, 2024

One small sticking point with those is only _reset is a valid quoted object key in JS:

{
  $reset: true, // ✅ valid
  _reset: true,  // ✅ valid
  !reset: true,  // 🚫 not valid
  %reset: true,  // 🚫 not valid
  @reset: true  // 🚫 not valid
}

Of course you could quote any of the above invalid ones, but it takes something away from the fluidity and legibility when you have to do that.

from formkit.

justin-schroeder avatar justin-schroeder commented on June 25, 2024

Wondering if it might be best to just call $reset a reserved word.

from formkit.

andrew-boyd avatar andrew-boyd commented on June 25, 2024

Reserving $reset feels reasonable in light of the above. I’m in favor.

from formkit.

luan-nk-nguyen avatar luan-nk-nguyen commented on June 25, 2024

As long as it's consistent between the Vue component and the schema, I think this will be ok. $reset seems like it could be a relatively common collision within schema — I could see people using it for functions or other things — so we might consider ways to make it clear that it is a reserved word.

from formkit.

justin-schroeder avatar justin-schroeder commented on June 25, 2024

Ok, this is implemented for all -class and fooClass attributes. Caveat, it does not work for the classes prop which will require the prefix: __raw__classes

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.