Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24966] Windows: Ti.UI.SearchBar's showCancel=false is ignored

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2017-08-07T22:25:08.000+0000
Affected Version/sRelease 6.1.1
Fix Version/sRelease 6.1.2
ComponentsWindows
Labelsmerge-6.1.2
Reporter Ricardo Ramirez
AssigneeKota Iguchi
Created2017-07-17T21:47:22.000+0000
Updated2017-09-18T20:29:25.000+0000

Description

Issue Description

The Ti.UI.SearchBar's showCancel=false is not returning the proper value

Steps to reproduce

Download the sample App https://drive.google.com/file/d/0BwTWo-c2a0b9eFJNTWIwek1tSmM/view?usp=sharing

Launch the sample app (can be tested deploying with -T ws-local) - a search bar will appear on it.

Type something on it and see how an "X" icon appears in the right side of the search bar.

**This works on Android and iOS.

Comments

  1. Kota Iguchi 2017-07-25

    As far as I see, there's no way to remove "X" icon from UWP's [AutoSuggestBox](https://docs.microsoft.com/en-us/windows/uwp/controls-and-patterns/auto-suggest-box). I would think this as platform component specification to keep consistency with other UWP components such as [TextBox](https://docs.microsoft.com/en-us/windows/uwp/controls-and-patterns/text-box). I would take this ticket as "won't fix" because of platform component spec. [~eharris] [~gmathews] Any thoughts on this?
  2. Ewan Harris 2017-07-25

    [~kiguchi] The only way I know of doing that would be to edit the XAML template and then remove the DeleteButton element. I found this UserVoice (it is for TextBox but similar element behaviour) which seems to be on the backlog, neither of the workarounds provided there translate to a AutoSuggestBox (simply at least) https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/6930042-textbox-property-to-show-hide-delete-button
  3. Kota Iguchi 2017-07-25

    Thanks [~eharris], it helps. I also found this article: [AutoSuggestBox styles and templates](https://msdn.microsoft.com/en-us/library/windows/apps/mt185404.aspx). This recalls me that we might be able to get the instance of DeleteButton component using [VisualTreeHelper](https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.visualtreehelper) so we can hide it explicitly. (We used to use VisualTreeHelper to [get scrollbar component from ListView](https://github.com/appcelerator/titanium_mobile_windows/blob/master/Source/UI/src/ListView.cpp#L82)). I will try.
  4. Kota Iguchi 2017-07-26

    https://github.com/appcelerator/titanium_mobile_windows/pull/1045 https://github.com/appcelerator/titanium_mobile_windows/pull/1046 https://github.com/appcelerator/titanium_mobile_windows/pull/1047
  5. Samir Mohammed 2017-07-27

    6_1_X: Has been merged as it was a priority. https://github.com/appcelerator/titanium_mobile_windows/pull/1046. Waiting to test 6_2_X and master
  6. Kota Iguchi 2017-08-07

    [~rramirez] This one is already released, available in [6.1.2.GA](http://docs.appcelerator.com/platform/latest/#!/guide/Titanium_SDK_6.1.2.GA_Release_Note).
  7. Kota Iguchi 2017-08-07

    [~smohammed] Could you do qe-test for https://github.com/appcelerator/titanium_mobile_windows/pull/1047 ? Then it's ok to merge for [master](https://github.com/appcelerator/titanium_mobile_windows/pull/1045) too because 6_2_X and master are pretty much same now.
  8. Abir Mukherjee 2017-09-18

    Changes seen in 6.2.0 GA.

JSON Source