Not able to set MaxLength property of the Masked-Input

Hi I am using a masked-input component in ember as below:

 {{#each tags as |tag index|~}}
   <li class="emberTagInput-tag">
     {{yield tag}}
     {{#if _isRemoveButtonVisible}}
     <a class="emberTagInput-remove" {{action 'removeTag' index}}></a>
     {{/if}}
   </li>
 {{~/each~}}
 
 <li class="emberTagInput-new">
     {{masked-input
     disabled=readOnly    
     class=(concat 'emberTagInput-input js-ember-tag-input-new' (if readOnly ' is-disabled'))
     maxlength='20'
     textMaxLength='20'
     placeholder=placeholder
     input-format='regex'
     input-filter='[A-Za-z0-9\ \-@#]{1,20}'
     input-filter-message='Complaint Id is not valid.'
     }}
 </li>

And I am using it in my hbs files as below:

<div class="col-md-2">
  <div class="form-group">
    <label for="due-date" class=" control-label">Complaint Id</label>
      {{#tag-input
         maxlength=20
         tags=tags
         addTag=(action 'addNewTag')
         removeTagAtIndex=(action 'removeTagAtIndex')
         as |tag| }}
        {{tag}}
     {{/tag-input}}
  </div>
</div>

I want to set max length for the input that I enter as text in the textbox that comes with this component, any help please which property sets the max length that one can enter in it? Thanks a lot please.

As a moderator, I edited the examples above to use code fences so they’re more readable.

1 Like

Assuming for the moment that this is from the ember-cli-maskedinput addon (you didn’t say), it looks from the source code, which you can read out on https://github.com/networkteam/ember-cli-maskedinput, like it determines the maxlength automatically from the pattern length and you can’t set it by hand yourself.

If your masked-input is coming from some other addon, then of course the answer might be different.