Fast: Text field change event not fired

Created on 8 Jul 2020  路  1Comment  路  Source: microsoft/fast

Describe the bug; what happened?
change event is not emitted on an fast-text-field element when the value is cleared or the last character is deleted.

What are the steps to reproduce the issue?
call addEventListener('change', ()=>console.log('change')) on an element and observe console

What behavior did you expect?
'change' event is emitted when value is cleared

In what environment did you see the issue?

  • OS & Device: [e.g. MacOS, iOS, Windows, Linux] on [iPhone 7, PC]
  • Browser Chrome
  • Version 83.0.4103.116

Is there any additional context?
This is important for integration with Aurelia e.g., where binding engine listens for events to update bindings

fast-foundation bug done request

Most helpful comment

I noticed looking into this that the behavior of fast-text-field diverges from the platform regarding when change events are fired. https://codesandbox.io/s/loving-jackson-rpi4j?file=/src/index.ts

A text input will only emit a change event after the user has finished changing the control and has moved focus away from the input. The behavior should mimic the behavior described here: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event

What you're likely looking for is the input event but I don't believe that the fast-text-field emits that event at this point. I'd like to propose the following:

  1. Correct the behavior of fast-text-field's change event to match the platform's <input type="text" />
  2. Update fast-text-field to emit an input event, again matching the platform's <input type="text />

>All comments

I noticed looking into this that the behavior of fast-text-field diverges from the platform regarding when change events are fired. https://codesandbox.io/s/loving-jackson-rpi4j?file=/src/index.ts

A text input will only emit a change event after the user has finished changing the control and has moved focus away from the input. The behavior should mimic the behavior described here: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event

What you're likely looking for is the input event but I don't believe that the fast-text-field emits that event at this point. I'd like to propose the following:

  1. Correct the behavior of fast-text-field's change event to match the platform's <input type="text" />
  2. Update fast-text-field to emit an input event, again matching the platform's <input type="text />
Was this page helpful?
0 / 5 - 0 ratings

Related issues

tbetous picture tbetous  路  4Comments

PhilippSonntagORGADATA picture PhilippSonntagORGADATA  路  4Comments

MarcSkovMadsen picture MarcSkovMadsen  路  6Comments

Valks picture Valks  路  3Comments

bheston picture bheston  路  3Comments