Weirdly behaving select component


Topic: Weirdly behaving select component

doweb priority asked 5 days ago

Expected behavior

The label disappears and stays gone when something has been selected

Actual behavior

The label redraws on top of the selected item, rather than remaining in it's place after a selection has been done. Note that this appears to occur on the 'onblur' event, when the user clicks elsewhere.

Resources (screenshots, code snippets etc.)

Note the label on top of the selected item

                      <MDBSelect
                    label="Sektionstype"
                    onValueChange={(e: any) => {
                      props.setIsChanged(true);
                      setSectionCache({
                        ...sectionCache,
                        entity: e.value,
                      });
                    }}
                    data={[
                      {
                        text: "Firma",
                        defaultSelected:
                          sectionCache.entity === ESectionEntity.Contact,
                        value: ESectionEntity.Contact,
                      },
                      {
                        text: "Personer",
                        defaultSelected:
                          sectionCache.entity === ESectionEntity.Person,
                        value: ESectionEntity.Person,
                      },
                      {
                        text: "Projekter",
                        defaultSelected:
                          sectionCache.entity === ESectionEntity.Project,
                        value: ESectionEntity.Project,
                      },
                      {
                        text: "Salg",
                        defaultSelected:
                          sectionCache.entity === ESectionEntity.Sale,
                        value: ESectionEntity.Sale,
                      },
                      {
                        text: "Dokumenter",
                        defaultSelected:
                          sectionCache.entity === ESectionEntity.Document,
                        value: ESectionEntity.Document,
                      },
                      {
                        text: "Aktiviteter",
                        defaultSelected:
                          sectionCache.entity ===
                          ESectionEntity.Appointment,
                        value: ESectionEntity.Appointment,
                      },
                    ]}
                  />

doweb priority answered 3 days ago

I'm unable to see the answer that the forum says has been posted?


Krzysztof Wilk staff commented 1 day ago

Hi!

Yes, the topic has been posted.

The issue with select is already debugged and fixed on our dev environment - it was caused by the MDBInput component and onBlur event (as you mentioned above). The fix will appear in the next release


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue
  • User: Priority
  • Premium support: Yes
  • Technology: MDB React
  • MDB Version: MDB5 4.1.0
  • Device: Macbook Pro
  • Browser: Chrome
  • OS: Mac OS
  • Provided sample code: No
  • Provided link: No