Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Material UI Select widget label always shrinked #3369

Closed
ValYouW opened this issue Jan 12, 2023 · 5 comments · Fixed by #3388
Closed

Material UI Select widget label always shrinked #3369

ValYouW opened this issue Jan 12, 2023 · 5 comments · Fixed by #3388
Labels
bug help wanted material-ui material-ui related theme issue

Comments

@ValYouW
Copy link
Contributor

ValYouW commented Jan 12, 2023

The SelectWidget always uses a shrinked label:
https://github.com/rjsf-team/react-jsonschema-form/blob/v5.0.0-beta.16/packages/material-ui/src/SelectWidget/SelectWidget.tsx#L67

The shrink property should be dependent on the current value, whether it is empty or not

I can provide a PR if it make sense.

@ValYouW ValYouW added bug needs triage Initial label given, to be assigned correct labels and assigned labels Jan 12, 2023
@heath-freenome heath-freenome added help wanted material-ui material-ui related theme issue and removed needs triage Initial label given, to be assigned correct labels and assigned labels Jan 13, 2023
@heath-freenome
Copy link
Member

@ValYouW Yes, any help is encouraged! If you do fix it, please also update the @rjsf/mui package as well since the code is essentially the same. Thanks!

@ValYouW
Copy link
Contributor Author

ValYouW commented Jan 13, 2023

ok. I have forked the repo and trying to build validator-ajv8 I get this error, any idea? I just forked, npm install, and trying to build...
(I built utils/core/mui successfully but can't run the tests without validator-ajv8)

(typescript) Error: D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/src/createAjvInstance.ts(45,16): semantic error TS2345: Argument of type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv8/dist/ajv").default' is not assignable to parameter of type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/core").default'.
  Types of property 'opts' are incompatible.
    Type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv8/dist/core").InstanceOptions' is not assignable to type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/core").InstanceOptions'.
      Type 'InstanceOptions' is not assignable to type 'CurrentOptions'.
        Types of property 'keywords' are incompatible.
          Type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv8/dist/types/index").Vocabulary | undefined' is not assignable to type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/types/index").Vocabulary | undefined'.
            Type 'Vocabulary' is not assignable to type '(string | KeywordDefinition)[]'.
              Type 'string | import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv8/dist/types/index").KeywordDefinition' is not assignable to type 'string | import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/types/index").KeywordDefinition'.
                Type 'CodeKeywordDefinition' is not assignable to type 'string | KeywordDefinition'.
                  Type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv8/dist/types/index").CodeKeywordDefinition' is not assignable to type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/types/index").CodeKeywordDefinition'.
                    Types of property 'code' are incompatible.
                      Type '(cxt: import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv8/dist/compile/validate/index").KeywordCxt, ruleType?: string | undefined) => void' is not assignable to type '(cxt: import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/compile/validate/index").KeywordCxt, ruleType?: string | undefined) => void'.
                        Types of parameters 'cxt' and 'cxt' are incompatible.
                          Type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/compile/validate/index").KeywordCxt' is not assignable to type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv8/dist/compile/validate/index").KeywordCxt'.
                            The types of 'gen._scope' are incompatible between these types.
                              Type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv/dist/compile/codegen/scope").Scope' is not assignable to type 'import("D:/MyProjects/react-jsonschema-form/packages/validator-ajv8/node_modules/ajv8/dist/compile/codegen/scope").Scope'.
                                Property '_names' is protected but type 'Scope' is not a class derived from 'Scope'.

@heath-freenome
Copy link
Member

Interesting that you are seeing that when others have not. What version of node are you running. Also, we are removing the ajv8 alias in a pending PR #3371 so hopefully when that merges in the next day or so this issue goes away.

@ValYouW
Copy link
Contributor Author

ValYouW commented Jan 14, 2023

I'm still on node 14 (old projects that I need to support). Weird indeed...

@ValYouW
Copy link
Contributor Author

ValYouW commented Jan 18, 2023

Just an update: After running npm install I've noticed that package-lock.json has been updated, so I deleted my node_modules, revert package-lock.json changes and ran npm ci - now it builds successfully.
It seems like a minor change to ajv is breaking it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted material-ui material-ui related theme issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants