Tradeshift / tradeshift-ui

Tradeshift UI is a framework-agnostic JavaScript library to help Tradeshift App developers to create cohesive user experiences and to provide reusable UI components.
https://ui.tradeshift.com
Other
33 stars 44 forks source link

Value is empty and onidle will not called after copying content after clear. #562

Closed wangcansunking closed 6 years ago

wangcansunking commented 6 years ago

Choose the section that applies to you and use the template to help us figure out how we can help you.


Bug report

Tradeshift UI version affected

v9.3.13

Expected Behavior

onidle and onsearch (entry Enter) will be called and the value is what is copied.

Actual Behavior

  1. onidle is not called.
  2. Press Enter the onsearch is called but the value is empty.

Steps to reproduce

  1. code:
    var search = ts.ui.ToolBar.search();
    search.value = 'Press ENTER here';
    search.onidle = search.onsearch = function(value) {
    ts.ui.Notification.success(value || 'Search cleared');
    };
  2. copy specified content test in search input
  3. click clear button
  4. click search button and copy again
  5. press Enter (optional, if we want to call onsearch)

Screenshots (optional)

image

image


Feature request

Description of feature

Example use cases and/or Prototype links

Designs and/or Prototype screenshots

wangcansunking commented 6 years ago

I find that it is because the _snapshot of InputSpirit and SearchModel is not updated after click clear.

wiredearp commented 6 years ago

That's exactly what happened! Sorry about the bug :grimacing: Thanks for digging in :beer: