mlaursen/react-md

[SelectField] Dense property not working

rafaelbrier opened this issue · 2 comments

The dense property is not working in the select field.

You can see in the documentation example, when clicking "Use dense spec" nothing happens:
https://react-md.dev/packages/form/demos#select-example

The problem is that the TextFieldContainer which is used by the SelectedField should have the class "rmd-text-field-container--dense-label" applied, so it changes the --rmd-form-text-height to use the "dense" variable, but as the image below shows it does not apply.
image

To compare with a normal TextField, the className "rmd-text-field-container--dense-label" is applied.
image

--- Out of Topic

  1. The readOnly prop does not work either

  2. Question: There's anyway to clear the input with a button or something else?

I would like to briefly congrats the work of the DEVs in this library.
I don't know how many people work on it, but it seems like few people and it's still one of the best I've seen in terms of components and theming; If you are filtering by SASS then it is the best.

Congratulations to all, when I have time I intend to contribute!

This should be fixed in the upcoming v2.7.1 release. It looks like I forgot to pass the readOnly and dense props down.

To answer your question about resetting the value, I think you should be able to reset the value by clicking a button since the value has to be controlled. A quick example: https://codesandbox.io/s/resetting-select-value-gjoyv?file=/src/Demo.tsx