# Not able to set MaxLength property of the Masked-Input

**URL:** <https://discuss.emberjs.com/t/not-able-to-set-maxlength-property-of-the-masked-input/18230>\
**Category:** Ember CLI\
**Created:** [September 22, 2020, 3:36pm UTC](https://discuss.emberjs.com/t/not-able-to-set-maxlength-property-of-the-masked-input/18230 "2020-09-22T15:36:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abdul](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@abdul](https://discuss.emberjs.com/u/abdul)\
**Post date:** [September 22, 2020, 3:36pm UTC](https://discuss.emberjs.com/t/not-able-to-set-maxlength-property-of-the-masked-input/18230/1 "2020-09-22T15:36:03Z")

</div>

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

```nohighlight
 {{#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:

```nohighlight
<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.

---

<div class="post-metadata">

**Author:** ![ef4](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ef4/32/13470_2.png) [@ef4](https://discuss.emberjs.com/u/ef4)\
**Post date:** [September 22, 2020, 5:42pm UTC](https://discuss.emberjs.com/t/not-able-to-set-maxlength-property-of-the-masked-input/18230/2 "2020-09-22T17:42:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Lupestro](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/lupestro/32/14034_2.png) [@Lupestro](https://discuss.emberjs.com/u/Lupestro)\
**Post date:** [September 23, 2020, 2:58am UTC](https://discuss.emberjs.com/t/not-able-to-set-maxlength-property-of-the-masked-input/18230/3 "2020-09-23T02:58:37Z")

</div>

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](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.
