Topic: MDBSelect dropdown list direction not auto set?

công võ free asked 5 years ago


*Expected behavior*Select dropdown will open up instead of down for default when the select box put at the end of screen or end of page. like this screen https://i.imgur.com/3UZPpp1.png

*Actual behavior*still open in the bottom and make page have more bottom spacing like this https://i.imgur.com/b1zGjFQ.png => on my project https://i.imgur.com/xZvSXT7.png => on your package example download from youth as well. (it happened on the latest version)

*Resources (screenshots, code snippets etc.)*And I don't see any props to control that?Please help me to make it work like your component on your site?


Konrad Stępień staff answered 5 years ago


Hi @công võ,

You can follow the change log

And if you need for now a solution, Can you follow my code?

import React, { Component } from "react";
import { MDBSelect } from "mdbreact";
import './App.css' // Remouve me if you have other file of styles

class SelectPage extends Component {
  state = {
    options: [
      {
        text: "Option 1",
        value: "1"
      },
      {
        text: "Option 2",
        value: "2"
      },
      {
        text: "Option 3",
        value: "3"
      }
    ]
  };

  render() {
    return (
      <div>
        <MDBSelect
          options={this.state.options}
          selected="Choose your option"
          label="Example label"
          className="list-top"
        />
      </div>
    );
  }
}

export default SelectPage;

and add this:

.list-top.select-wrapper ul {
  bottom: 0 !important;
  top: initial !important;
}

for your styles.

But for fix the component you have to wait.

Best regards, Konrad.


Konrad Stępień staff answered 5 years ago


Hi @công võ,

Thank you very much for your feedback and fonded bug! But it is not possible for this time. Examples from the documentation are in jQuery technology because it is only for presents examples.

We will fix this in the near future. I forwarded it to our technical team.

If there is anything else I could do for you do not hesitate to ask me. I'll be happy to help you.

Best regards, Konrad.


công võ free commented 5 years ago

Hi [@Konrad Stępień](/profile/?id=64314), How to know that issue is fixed? please confirm to me, BTW, if you have any solution to quick fix that issue, please help me leave your code in this topic. Thank you so much.



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

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.18.1
  • Device: All
  • Browser: All
  • OS: All
  • Provided sample code: No
  • Provided link: Yes