ALERT with input text and checkbox - IONIC 3

Asked

Viewed 243 times

0

Hello, Need to create in a component Alertcontroller with a checkbox list and a text field , same in the code below

alert.setTitle('Registrar item ? ' + p.descricao_resumida);
        for (let course of this.obs_preparo) {
          console.log(course.observacao)
          alert.addInput({
            type: 'checkbox',
            label: course.observacao,
            value: course.id
          });
        }
        alert.addInput({
          type: 'text',
          name: 'quantidade',
          value: '1',
        });

But when it is displayed, the text field appears in checkbox format, Can anyone help me?

1 answer

0

In the official documentation found at that link says the following:

(...) Radios, checkboxes and text inputs are all accepted, but they cannot be Mixed. For example, an Alert could have all radio button inputs, or all checkbox inputs, but the same Alert cannot mix radio and checkbox inputs. (...)

Translating, it means that Alerts cannot possess types of input different. Then use a checkbox and a text input is not allowed, this is a limitation of the component itself. Note that, different types of input doesn’t mean you can’t have two inputs text-type tel or number, in that case it is permitted.

Official documentation suggests you create a modal own in place to do what you want.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.