blur event not firing on iOS Mobile Safari in Sencha Touch - ios

I'm using iOS 5.0.1, and Sencha Touch 2-rc1. I have a search input field where the focus event is getting triggered, as well as the submit event when I press 'Search' on the on-screen keyboard. The blur event doesn't get triggered when I expect it to, which would be when the 'Done' key is pressed, or the viewable area is tapped.
Note that the blur event IS getting triggered on my laptop in Chrome.

Not every element is focusable. At least <div> is not.
onblur is not firing because when a user taps on a div element, the focus doesn't go to the <div>.
Based on this post:
http://snook.ca/archives/accessibility_and_usability/elements_focusable_with_tabindex
tabindex on the correct div element can make a div focusable.

This is likely to be related to the event not "bubbling" up through the DOM. Or perhaps the code you've used includes an event.preventDefault(), but that would have killed more than just blur. I've also had this issue with clicking away from items which appear via javascript.
http://www.quirksmode.org/dom/events/blurfocus.html

Related

Textbox lostfocus event doesn't fire when using a default button

Today I stumbled upon a problem with a LostFocus event from a TextBox that didn't fire. Most clients didn't have any problems but a small portion of them reported unexpected behavior. After some research I found that the clients who didn't had the problem clicked on the "Ok" button with the mouse while the other clients pressed Enter on their keyboard. The "Ok" button was the default button on the Form so pressing Enter should work just fine. The problem is that pressing Enter doesn't fire a LostFocus event on the TextBox with focus.
After some Googling it was pretty clear that this is the expected behavior of a default button. The focus never loses the TextBox and the code behind the CommandButton Click event is being run without it being clicked.
How to get the LostFocus event to fire when using a default button?
A simple hack that worked for me is to set the focus to the "Ok" button whenever the Click event is being fired. That way the current control automatically runs its LostFocus event. Don't forget to put an extra DoEvents after setting the focus. Otherwise the LostFocus event fire after your other code has been executed.
Private Sub cmdOk_Click()
cmdOK.SetFocus
DoEvents
'Run your other code
End Sub

IONIC - scroll is fired twice when some input is focused on ios

I'm facing an issue with IOS and ionic, if anyone can help with any information about this issue, feel free to share, please.
obs: i'm not using ion-content or any other ionic directive.
THE BUG: i have a form with a lot of inputs.
when the keyboard is open and i click in an input that is not in the middle of the view and is not focused, this input is scrolled to the middle of the view, but then this same input loses the focus and the view is scrolled to the next input that doesn't have focus.
I have tried this workarounds below but no success:
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true); // <- this code is disabling all the app scroll
$ionicConfigProvider.scrolling.jsScrolling(true);
Another observation: I put an event listener in all the scroll events in the body, html and window, but this scroll event that happened when input get focus doesn't fire the listener.
I finally find some solution. the mobile devices wait 300ms after the touchend event to then fire the click event, the ionic has an implementation to fix this 300ms delay, and it is made by firing the click event in the touchend event without wait the 300ms and preventing the device to fire the click event after the 300ms. and i think ionic failed to prevent the device to fire the click, causing a ghost click.
the way i solved this: add data-tap-disabled="true" in the elements you don't want to use this 'delay fix' by ionic and the element will respect the normal way to do this, waiting the 300ms then firing the click.

How to keep soft keyboard opened on iOS. Flash Builder 4

I'm building chat application for mobile devices with Adobe Flash Builder 4.6.
I have s:TextInput for message entering and s:Button for sending message.
When user enters message and taps "Send" keyboard goes down. I want to keep it opened.
I can use textInput.setFocus() and setFocus with setTimeout(), but it gives unexpected results sometimes. For example soft keyboard can jump or goes down without resizing stage.
Could you recommend good solution for keeping soft keyboard opened when taping outside text input (focus should left in text input).
What worked for me was:
Create a listener for the TextInput focus out event
Put textInput.setFocus() code in that listener handler
When I want the textInput to be able to focus out for specific cases I create a lockFocus variable for the listener to check first before deciding to reassign focus or not.
Hope that helps!

JQuery Mobile list elements overly sensitive to taps

I've noticed that when I have long list elements in JQuery Mobile and I try to scroll them, I accidentally select an element. Overall the act of scrolling tends to get confused with tapping.
I did some comparison to a native iOS list and here is the difference:
In JQueryMobile, as long as you do a MouseDown and MouseUp on an element, it is considered a click. It doesn't matter if you've scrolled inbetween the events.
In iOS, if you do a MouseDown on an element and then scroll at all, the MouseDown is effectively canceled. This allows you to tap on something, scroll the page up and release without it being considered a click.
Has anyone noticed this and/or developed a patch for it? If not, any suggestions on a fix?

Select text in HTML with GWT mouse events sunk

I have a <div> with some text and I would like the user to be able to natively select the text. The issue is that when I attach any mouse event handler to the element or it's parent (besides document element) the selection won't work any longer.
This could be observe on the site linked below. If you sink mouse events the selection won't work for the first line.
http://rafalrybacki.com/lab/selection_ios/
What happens after clicking "sink mouse events" is:
main.sinkEvents(Event.MOUSEEVENTS);
Checked with iOS5.
I would like make the text selecting work (keeping the mouse events). How to do this?

Resources