Skip to content

Clicking on disabled input checkbox modify checked value #120

@livet01

Description

@livet01

I create a component my-input-component.hbs:

<input type="checkbox"
   checked={{checked}}
   disabled={{disabled}}>

and I add a integration test:

import { click, find } from 'ember-native-dom-helpers';
//...
test('disabled state', async function(assert) {
   await render(hbs`{{my-input-component disabled=true checked=false}}`);
   assert.notOk(find('input[type="checkbox"]').checked);

   await click('input[type="checkbox"]');
   assert.notOk(find('input[type="checkbox"]').checked);
});

The second assert.notOk fails, find('input[type="checkbox"]').checked returns true.

If I replace click helper by something like that, it's working:

Ember.run(() => document.querySelector('input[type="checkbox"]').click());

Do you have any idea about why click has this behaviour? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions