ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: Radio button focus interferes with textarea blur

Open jeremyrussell opened this issue 11 years ago • 4 comments

Type: bug

Platform: mobile webview

This issue relates to the scrollview's movement to keep input fields above the keyboard. It works fine when you focus an input field (eg. textarea), the input scrolls into view as the keyboard appears. When you tap an empty part of the screen for example, the field blurs dismissing the keyboard and the input scrolls back to its original position.

What doesn't work is when the input field has focus and rather than tapping an empty part of the screen, instead you tap on a radio button, the scrollview does not return the input to its original position, despite the fact that the keyboard is dismissed. The result is that a big slab of white space is added to the scrollview because the scrollview has not correctly responded to the keyboard dismissal.

The cause of this bug looks to be the tap handler, the following link shows the very minimal code change that resolved the issue for me.

https://github.com/driftyco/ionic/compare/master...jeremyrussell:tap-handle-focus-fix

I have uploaded two videos to youtube to illustrate the expected and current behaviour.

Expected behaviour: http://youtu.be/Luy4gpHYFk4 Current behaviour: https://youtu.be/9s-5rZniSuM

And, here's a codepen: http://codepen.io/jeremyrussell/pen/jPLrPX Note, however that the app needs to be run as a hybrid app to reproduce the error

jeremyrussell avatar Jun 12 '15 05:06 jeremyrussell

This issue duplicates with those ones: https://github.com/driftyco/ionic/issues/4057 and https://github.com/driftyco/ionic/pull/4007.

amazaud avatar Jul 20 '15 08:07 amazaud

Greetings @jeremyrussell!

I've closed this issue because my sensors indicated it was old and inactive, and may have already been fixed in recent versions of Ionic. However, if you are still experiencing this issue, please feel free to reopen this issue by creating a new one, and include any examples and other necessary information, so that we can look into it further.

Thank you for allowing me to assist you.

Ionitron avatar Oct 18 '15 09:10 Ionitron

Did #4007 fix it for you?

mlynch avatar Dec 06 '15 23:12 mlynch

Hi @mlynch,

I have now had a chance to test the fix you referred to, I can confirm that the issue reported above is resolved. Unfortunately however, I would not say that I am seeing is what I would consider consistent behaviour between the non-keyboard input types. I have created the following codepen tied to the latest version of ionic v1.2.4 http://codepen.io/jeremyrussell/pen/xZrPbv to demonstrate the difference between radios, toggles and checkboxes. In short tapping a checkbox or toggle while a textbox or textarea has focus does not blur that field, in contrast to tapping on a radio button which does blur the field.

I will probably need to create a separate issue for this, but I think it was worth mentioning here too

jeremyrussell avatar Jan 12 '16 01:01 jeremyrussell