IONIC - scroll is fired twice when some input is focused on ios - 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.

Related

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?

blur event not firing on iOS Mobile Safari in Sencha Touch

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

Why does my textarea's blur event not get fired before my jQuery UI dialog is closed?

I have a textarea element inside of a jquery modal dialog that has an attached blur handler. The blur handler code is triggered correctly in Chrome and Internet Explorer when the click of the button on the dialog, which calls $('#mydialog).dialog('destroy').remove(); occurs.
Unfortunately, in Firefox this is not happening!
Why might this be?
I was able to eventually resolve the issue by utilizing setTimeout to wrap the click handler code in, which allowed enough time for the blur event on the textarea to fire properly.
The resulting code was as follows:
var c = $('#mydialog');
setTimeout(function() {c.dialog('destroy').remove();}, 1);
As it turns out so far, a 1ms timeout is just enough to force the appropriate context switch in the browser to allow for the blur event to occur before the element is removed from the DOM.

Cordova app in ios13 device behaves weird with click or swipe actions

I have a cordova app. I have written some custom code in file for swipe actions using touch events, mouse events which will identify the touchmove and swipe. I have a hamburger menu at the top left corner of my app. On clicking this will open a side panel with some animation. on opening the app in latest ios 13, first time click anywhere on the screen is having MouseEvent with x,y,screenX,screenY,pathX,pathY values as 0. this triggers the hamburger menu which is at the top left corner of app and opens the side panel.
Why is the first time click event on screen returns x,y values as 0?
This issue doesn't occur in Android device or iOS <= 12.0 version. Only observed in iOS 13.
On removing my code specific to touch, swipe events. Then this issue is not replicable.
I have another observation. As ios13 supports the pointer events, I have just tried to add code related to pointerEvent
document.addEventListener('pointerdown', function() {
console.log('pointerdown event');
})
This worked for me without removing any code related swipe.
Why there is such difference in the behaviour with the code.
Thanks in advance.
Thank you for your description, we also effected by this issue. Sometimes we experience "ghost" clicks on previous clicked place in our cordova app.
Only happens with iOS13, with both UIWebView and WKWebView.
Seems pointerdown eventlistener is a workaround for this.

Resources