1

I am trying to put an html input to the right of ion checkbox but it is not working.

<label>
    <ion-checkbox ng-model="mode" ng-checked="checked">
        <input type="text">
    </ion-checkbox>
</label>

However, it works if text is being inserted

<label>
    <ion-checkbox ng-model="mode" ng-checked="checked">
        Label
    </ion-checkbox>
</label>

1 Answer 1

1

Technically it is working,

First I would add a placeholder value to the input box so you can see some sort of value.

<label>
   <ion-checkbox ng-model="mode" ng-checked="checked">
      <input type="text" placeholder="Input">
   </ion-checkbox>
</label>

Now that we see the input, we can't click on it, because ionic have added a class in the background to disable all pointer events on Inputs that are inside of Checkboxes.

To fix this, we simply add this to our css.

.item-checkbox .item-content{
  pointer-events: auto;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.