Topic: select placeholder

khilliard free asked 5 years ago


If I add a "selected" property to an option tag I expect that this option will be shown initially in the select.

Instead, the select initially shows a blank entry. Additionally, if I select a particular option then that option is displayed if display the select again. Please note: the select is being displayed in a modal popup. The select is part of a form that I display modally.

Here is a code snippet:

  <select v-model="selectedPresentation" class="browser-default custom-select" required>
    <option value="" selected="selected">Select presentation</option>
    <option v-for="(presentation, index) in presentations" :key="index" :value="presentation.id">{{presentation.name}}</option>
  </select>

Magdalena Dembna staff answered 5 years ago


Hi, In order to review this problem I have to ask you to share your entire code for the component. I ran a test on the code snippet below and everything seems to work fine - initially select displays 'Default' as it should. Kind regards, Magdalena



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 Vue
  • MDB Version: 5.2.0
  • Device: pc desktop
  • Browser: chrome, edge
  • OS: windows 10
  • Provided sample code: No
  • Provided link: No