Topic: Input mask placeholder not behaving as expected
robbyirish free asked 1 year ago
I updated the code and example below to the actual code I'm using, not just a barebones example.
when focusing on input field with placeholder but then unfocusing without providing input the placeholder should remain/return
Placeholder is replaced with mask placeholder
Resources (screenshots, code snippets etc.)
Here's the code I'm using and an example.
<input type="text" id="workshopDate" name="date" class="form-control form-control-lg rounded-5" data-mdb-input-mask="99/99/9999" data-mdb-mask-placeholder="true" data-mdb-char-placeholder="DD/MM/YYYY" data-mdb-input-placeholder="false" placeholder="e.g. 03/09/2021" required >
We will discuss this in our team and see what we can do about it. As for now, I will advise to use label for "e.g. 03/09/2021" instead of placeholder. You can see an example here https://mdbootstrap.com/docs/standard/plugins/input-mask/#section-mask-placeholder. Input mask has higher priority than provided placeholder, so it gets replaced after focus.
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: MDB5 3.9.0
- Device: MacBook pro
- Browser: safari, chrome
- OS: Mac OS 11.6
- Provided sample code: No
- Provided link: No