Nativescript Vue: How to dismiss searchBar keyboard when scrolling ListView? - nativescript

I have a SearchBar component and a ListView component. When I tap the search bar, the keyboard comes up but it stays up even if the user decides to scroll ListView under it. I can't seem to find either
1) any event on the ListView that I can trigger the search bar to close on when it's scrolling
--or--
2) any event on the search bar that I can check to see if it's not focused , then close it.
Either of those would be sufficient but I can't seem to find any in the documentation.

Both components are independent of each other, you must call dismissSoftInput() on the search bar upon scroll.
Unfortunately the scroll event is not supported out of the box while using ListView. There is an open feature request on Github, which also discusses how you may implement this event with an override & bit of native code in your project. You may also consider using RadListView, supports scroll events out of the box.

Related

What difference does it make if I use the SearchBar control versus the Entry control to search a ListView?

Regarding Xamarin.Forms, I've been reviewing the Entry control documentation along withe the SearchBar control documentation. After reviewing the documentation for both, they appear to be similar.
What difference does it make if I use the SearchBar control versus the Entry control to search a ListView?
I think they are functionally similar but the key difference in SearchBar is that you get different visualization and keyboard at least on iOS and Android. The Enter button has a custom icon or text and there is an icon in the entry field. Images of different devices can be found here. You can also see images of SearchBar on Android here:
The Entry when rendered is just a Textbox, using this for search is possible but you will need to manually add a search button (if needed), cancel mechanism and attach yourself to the events to make the search. In the other hand using the SearchBar all this is already part of the control, out of the box for you.
If you don't need this extra functionality or you don't mind having to rewrite it you can use the Entry otherwise go with the SearchBar.

How to check if tapped region falls inside a PopUp Control

I am using tap event listener from wp toolkit. In my app I show a pop up screen. I have defined the gesturelister to work on the Grid. In capturing the Tap gesture event, I get the screen coordinates (i.e X and Y) where it happened.
Now i want to know if the Tap happened inside the PopUp control or outside it. How can i achieve this on wp8. I have tried many solutions but none seems to work. Please help on this.
Is the Grid under or over the PopUp Control?
If yes, the solution is pretty simple.
When the click is on the Popup the Grid will not receive it.
When the click is not on the Popup the Grid will receive it.

WinRT Settings Charm. Elements overlayed by on screen keyboard

I'm developing for Windows 8 (WInRT) and have problem with settings charm. Settings popup is based on Microsoft SDK settings charm. Settings panel is Popup. Content is wrapped by ScrollViewer -> Grid -> StackPanel. In StackPanel I have input fields. when I trying to fill last of them on screen keyboard overlaying it and I cant see field and cant scroll to it. Is there any way to see it and to scroll to it automatically?
Seems like the popups on Windows 8 suffer from the same problem as they did on Windows Phone in that when you put a TextBox on one of them - it does not get pushed up together with all the other content as it does when it is not in a popup.
My solution to that would be to not use popup for input fields and instead go for a layout that you can manage yourself.
By default the app has a Frame control at its visual root. You can modify it for example by putting your own UserControl in there (I usually call it AppShell) which has the Frame used by all pages, you can have a layer for popups, log in screens, the extended splash screen etc.
To solve your problem you would need to put your charm's UI inside of such layer instead of in a popup. Then the build-in mechanism that pushes all the UI up when the on-screen keyboard would otherwise obstruct the view of your TextBox should just start working again.
*EDIT
A simpler solution might be to make sure your settings panel popup is parented in your visual tree - e.g. by adding it as a child element to a root grid of your app or page. It turns out that in that case its content does get pushed up when the OSK shows up.
Take a look at this post
It's a popup wrapper (turns user controls into popups) that takes care of the keyboard appearing and adjusts the size of the popup (and thus the user control) accordingly.

windows phone mango - differences between click and tap

Can anybody give me more details on this?
I know that tap is coming from gestures, but I'd like to know more on WP7 events model.
For instance how following scenarions work:
stackpanel with tap event and checkbox inside which handles click
container with tap and any framework element also with tap, etc.
Which events have more priority and if is it possible to mask events?
What kind of event bubbling is used here from top to bottom or vice-versa?
If you're using WP7.1 SDK the easiest thing to make things consistent would be to use the Tap event everywhere (it's available on all UIElement derived controls). Tap events are bubbled up from the lowest control in the visual tree until a handler is found.
Then you don't need to worry about if/when Click and Tap will clash.

scroll tip in list control

In Windows 7, the explorer shows a scroll tip in detailed view like this:
alt text http://i.msdn.microsoft.com/Dd378445.scrolltip%28en-us,VS.85%29.jpg
This image is taken from this MSDN page, but there's no information there on how to activate this for a plain list control.
I'd like to get my list controls to do the same, but I can't figure out how to do this.
There's the LVN_BEGINSCROLL and the LVN_ENDSCROLL notification message, but no LVN_SCROLL message which is sent while scrolling so I could implement my own scroll tip and updating it while scrolling.
I haven't found any window styles or settings for the list control to activate this feature either.
But since Windows 7 can do this, it must be possible somehow. Anyone got an idea how I could implement/activate this feature?
You could probably subclass the listview and catch WM_VSCROLL
A somewhat related article in MSJ implemented "scroll tips" and deferred scrolling

Resources