Placeholder dynamic can't be deactivated


Topic: Placeholder dynamic can't be deactivated

THIRIAU asked 5 years ago

Hello, I use input like this:

 <div class="md-form md-outline">
    <input mdbInput type="text" class="form-control" id="'specificId" [placeholder]="field.placeholder">
    <label for="'specificId">{{ field.label }}</label>
</div>

When "field.placeholder" is set, it works great, but when it is null, it is marked "null" in the input and label is written in the top of the input. If "field.placeholder" = '' (empty string), placeholder is empty but label is written in the top of the input, not instead of placeholder. The field consider that there is a placeholder. How to deactivate it dynamically when "field.placeholder" is not set or null ?


Arkadiusz Idzikowski staff answered 5 years ago

It looks like this is how Angular handle this case and it's not related to MDB library. Please try to set field.placeholder value to empty string instead.


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: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 9.0.1
  • Device: Mac
  • Browser: Safari
  • OS: macOS Catalina
  • Provided sample code: No
  • Provided link: No