MDBInput weird behavior on init render


Topic: MDBInput weird behavior on init render

drimaco asked 2 years ago

THIS PROBLEM OCCURS AFTER UPDATE TO 4.1.0, in 4.0.0 everything is fine.

Expected behavior On the INITAL RENDER the Placeholder placed in the MDBInput. After clicking it the Placeholder moves to the top. Whithout any input leaving the MDBInput the Placeholder is moving back.

Actual behavior On the INITIAL RENDER the Placeholder is already on top. After clicking in the MDBInput the Placeholder is still on top. After leaving the MDBInput whithout any input the Placeholder is moving back. This only occours on MDBInputs with a State as init value "".

So the problem is that every MDBInput with a initial state value of "" looks like an MDBInput with a active input.

Resources (screenshots, code snippets etc.)

MDBInput on INITIAL RENDER

                        <MDBInput
                            onChange={(e) => setSearchTerm(e.target.value)}
                            label={
                                <>
                                    <MDBIcon fas icon='search' className='ms-1 me-2' />
                                    Artikel suchen
                                </>
                            }
                            type='text'
                            contrast
                            value={searchTerm}
                        />

Krzysztof Wilk staff commented 2 years ago

Hi!

We already fixed that in our dev repository. The fix should appear in the next release on Monday :)


drimaco commented 2 years ago

Very nice. Thank you :)


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Open

Specification of the issue
  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: MDB5 4.1.0
  • Device: PC
  • Browser: Chrome
  • OS: Win 11
  • Provided sample code: No
  • Provided link: No
Tags