GovAlta / ui-components

ui-components contains the code you need to start building a user interface for Government of Alberta platforms and services.
Apache License 2.0
16 stars 25 forks source link

Clear ('x') icon doesn't fire _change event on goa-input #492

Closed DarylChiew closed 2 years ago

DarylChiew commented 2 years ago

Describe the bug

When using the <goa-input> web component, after typing in 1 or more characters, hovering over the input displays a clear button in the right side of the input box.

image

Clicking on the 'x' clears the text, but the _changeevent on the goa-input control is not fired.

What is the level of criticality

Medium - One of the other input events can be hooked into, but then I can't make use of the _changeevent since both events will get fired.

To Reproduce (include pictures or video if helpful)

Steps to reproduce the behaviour:

  1. Create an angular project (although I'm sure any web project that can integrate the web components will work).
  2. Use something similar to the following html:
    <goa-input leadingicon="search" type="search" placeholder="Search for an item"
    (_change)="onSearchChange($event)"
    ></goa-input>
  3. Implement the onSearchChangeevent handler. Add console.log(...) to help with debugging.
  4. Run the app and note that the onSearchChangeevent handler is fired when text is entered but is not fired when the 'x' is clicked.

Expected behaviour

When the 'x' icon is clicked in the input control, the text box should be cleared and the _change event fired to indicate the text box is now empty.

System configuration

Desktop (please complete the following information):

Duplicate of: https://github.com/GovAlta/ui-components/issues/658

Spark450 commented 2 years ago

@DarylChiew are you able to handle _trailingIconClick event and clear the attributes value manually?

DarylChiew commented 2 years ago

@Spark450 it does work that way, but using type="search" causes 2 'x's to show up. image

Workaround was to use type='text' and . Should search be removed? Or are there still plans for this type?

Spark450 commented 2 years ago

@Spark450 it does work that way, but using type="search" causes 2 'x's to show up. image

Workaround was to use type='text' and . Should search be removed? Or are there still plans for this type?

@chrisolsen are you able to reproduce this on your end and investigate further? I think the "black x" should show and blue one should not (from a visual perspective)

tzuge commented 2 years ago

:tada: This issue has been resolved in version 3.4.0-alpha.60 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

tzuge commented 2 years ago

:tada: This issue has been resolved in version 1.0.0-alpha.54 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

tzuge commented 2 years ago

:tada: This issue has been resolved in version 1.0.0-alpha.8 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

tzuge commented 2 years ago

:tada: This issue has been resolved in version 2.0.0-alpha.6 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

tzuge commented 2 years ago

:tada: This issue has been resolved in version 2.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

tzuge commented 2 years ago

:tada: This issue has been resolved in version 4.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

tzuge commented 2 years ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

tzuge commented 2 years ago

:tada: This issue has been resolved in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: