Topic: Missing data-mdb-placeholder css class
Expected behavior https://mdbootstrap.com/docs/standard/forms/select/#section-select-with-placeholder
Expected to find data-mdb-placeholder class as per the URL above.
Actual behavior
Looked at both 3.1.0 and 3.2.0 but don't see this class.
Resources (screenshots, code snippets etc.)
The documentation on the web should clearly annotate which version these things are introduced in - or perhaps there should be version specific documentation. This is quite frustrating.
Grzegorz Bujański
staff answered 2 months ago
When creating the select component, we made sure that it works in the same way as the native select. Therefore, in this case, you cannot set up a placeholder this way.
This will only work for Multiselect. You can add an option with an empty value and selected attribute. I also suggest adding a hidden attribute so that it doesn't show up in the options list. This will make select appear as if it had a placeholder. Here's an example: https://mdbootstrap.com/snippets/standard/grzegorz-bujanski/2862444
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB 5
- MDB Version: 3.2.0
- Device: Macbook
- Browser: Chrome
- OS: MacOS
- Provided sample code: No
- Provided link: Yes
Grzegorz Bujański staff commented 2 months ago
What do you mean you don't see this class? Does the attribute:
data-mdb-placeholderwork for you? This attribute has not been added in the meantime. It has been available since version1.0.0-alpha2in which we added the select component.vgoenka pro premium commented 2 months ago
The attribute didn't work when I tried. (my bad about calling it 'class' in my comment above).
I'm only including mdb.min.css and mdb.min.js. Do I need to include any other file?