Skip to content

Change from null to undefined introduces issues with <value> !== undefined #673

@bedrich-schindler

Description

@bedrich-schindler

This is caused by #662


As result of mentioned change, TextField is incorrectly setting hasRootSmallInput class when inputSize is set to null. This is happening on following line: https://github.com/react-ui-org/react-ui/blob/master/src/components/TextField/TextField.jsx#L35

Problem is that if inputSize is set to null:

const hasSmallInput = (inputSize !== undefined) && (inputSize <= SMALL_INPUT_SIZE);

Then inputSize is true because of inputSize <= SMALL_INPUT_SIZE => true. Why? Because null <= 10 ...

We need to investigate this and examine all occurrences of !== undefined and !== null as well. This is why I always recommend using != null to cover both cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    💡Ideas

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions