GithubHelp home page GithubHelp logo

Comments (4)

jcger avatar jcger commented on June 21, 2024

It is the expected behaviour

disabled: user can't write and the input shows up disabled (see disabled demo)
readOnly: user can't write but the input looks active, used by one of our select variants, in which the user can't write to choose its option (see with placeholder demo)

from sui-components.

juanmendez90 avatar juanmendez90 commented on June 21, 2024

In the case of molecule/select, the readOnly is implicit so the input will be disabled and its value will be ignored when submitted. I also found that is not possible to set a name to it. Should I use a hidden input that stores the atom/select value?

from sui-components.

juanmaguitar avatar juanmaguitar commented on June 21, 2024

Hi @juanmendez90, I answer you below...

the readOnly is implicit so the input will be disabled and its value will be ignored when submitted.

The MoleculeSelect component is not really a select but a div that emulates a select behaviour. That's why the value of the select should be captured from a higher component that manages the state of the component (or the general state of the form). For that, there's a onChange prop that can be used to pass a handler that will be triggered on every value change (receiving that value)

I also found that is not possible to set a name to it

For that same reason (The MoleculeSelect component is not really a select but a div that emulates a select behaviour.) you cannot set a name for this component. And also for the same reason ( the value of the select should be captured from a higher component that manages the state of the component ) you shouldn't need to set a name in this component, because the submit of the form should be handled programmatically by the higher component that manages the state of the whole form

from sui-components.

juanmendez90 avatar juanmendez90 commented on June 21, 2024

Ok got it, I will close the issue then, thanks for your answers

from sui-components.

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.