emberx-select icon indicating copy to clipboard operation
emberx-select copied to clipboard

When select is rendered it should not fire `onChange` action if `value` property is equal to `null` or `undefined`

Open enterpub opened this issue 5 years ago • 2 comments

Version of x-select: 4.0.0-beta.2

Ember Version: 3.10.2 Ember CLI Version: 3.10.1

I think when select is rendered it should not fire onChange action if the value property is equal to null or undefined. BTW, if value property is equal to anything else, than null or undefined the onChange action does not fire. For example, I have a list of insurance types:

<XSelect @value={{this.insuranceTypeId}} @onChange={{action "showInsuranceTypePopup"}} as |xs|>
    <xs.option>None</xs.option>
    <xs.option @value=1>Medicare</xs.option>
    <xs.option @value=2>Medicaid</xs.option>
    <xs.option @value=3>Tricare Champus</xs.option>
    <xs.option @value=4>Champva</xs.option>
    <xs.option @value=5>Group Health Plan</xs.option>
    <xs.option @value=6>FECA Black Lung</xs.option>
    <xs.option @value=7>Other</xs.option>
</XSelect>

The initial value of 'this.insuranceTypeId' is equal to null, because no of the license is chosen and this is normal. But the addon fires onChange action. I do not get it why? Nothing changed. In my case it brings an issue, because implementation of showInsuranceTypePopup action shows a popup, so my users, when page has been loaded, have to close the popup first, then do what they want. In every such case, I have to workaround this issue. In emberx-select version 3.x it did not fire the event, now it does.

What do you think?

enterpub avatar Jun 26 '19 13:06 enterpub

Seeing the same thing. It confused me as it had a weird behavior in my app.

corrspt avatar Jul 27 '19 14:07 corrspt

+1

aandis avatar May 08 '20 09:05 aandis