Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 1, 2020. It is now read-only.
This repository was archived by the owner on Jun 1, 2020. It is now read-only.

RangeWidget / Material-UI Slider throws continuous Exception if no default value given #128

Open
@lgersman

Description

@lgersman

Hi guys,
you did a great job !

I have just one tiny issue - when using the range widget ("ui:widget": "range")and the schema defines no default value the Material-UI Slider throws continuous Exceptions :

Material-UI: A component is changing an uncontrolled Slider to be controlled.Elements should not switch from uncontrolled to controlled (or vice versa).Decide between using a controlled or uncontrolled Slider element for the lifetime of the component.More info: https://fb.me/react-controlled-components    in Slider (created by WithStyles)    in WithStyles (created by RangeWidget)    in RangeWidget (created by Anonymous)...

since the control cannot bind tostate.value

This can easily be fixed by providing0 as default value to the value Parameter in

like this :

const RangeWidget = ({  value = 0,  readonly,  disabled,...

Hope this helps you guys a bit.

One more suggestion : It would be nice to add some additional classes to the FormLabel of the RangeWidget to make styling easier. For me the most confortable tweak right now is to use

<FormLabel    id={id}    className="MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiFormLabel-filled"        >   {label}</FormLabel>

which lets it look like the text input label.

But it would make more sense not to apply the InputLabel classes for but slider namespaced css classes. Its just a suggestion..

Happy coding,

Lars

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp