question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tap on textarea outer edge opens keyboard but textarea is not focussed sometimes

See original GitHub issue

Short description of the problem:

When clicking on the outer edge of a textarea, the keyboard opens but the textarea is sometimes not focussed. This is somehow strange because the keyboard is supposed to open on textarea focus. Therefore, I’d expect the textarea to be always focussed when the keyboard shows up. To close the keyboard, you must then first tap again the textarea so that it is focussed, and afterwards the ion-content area to unfocus and close the keyboard.

Analysis shows that the keyboard registers the tap and opens (keyboard plugin being used) but the textarea does not fire a focus event. Both ng-focus or a custom directive binding element.on(‘focus’) do not get triggered.

What behavior are you expecting?

The textarea gets focus, the cursor is placed into the textarea and the keyboard opens. In other words, if the keyboard opens, the tapped element should fire a ‘focus’ event.

Steps to reproduce: This happens in a production app which is available in the App Store. To easily reproduce I have created a simple repository based on the tabs-starter project. In tab “Dash” there is an ion-footer-bar containing a textarea. Tapping the textarea mostly focusses it, sometimes not, especially when tapping along the textarea edges: https://github.com/leschirmeur/textareaApp

Ionic Version: 1.x / 2.x 1.2.4

Browser & Operating System: iOS / Android / Chrome iOS 8 and 9

Run ionic info from terminal/cmd prompt:

Your system information:

Cordova CLI: 5.4.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.4
ios-sim version: 5.0.6
OS: Mac OS X El Capitan (wrongly detected, running on OS X Yosemite)
Node Version: v0.12.7
Xcode version: Xcode 7.2.1 Build version 7C1002

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
SebastianSchirmercommented, Jul 14, 2017

Good luck

1reaction
aycron-devcommented, Jul 14, 2017

Thanks for this answer! I’m implementing this now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tap on textarea border opens keyboard but textarea is not ...
When clicking on the border/outer edge of a textarea in a footer bar, the keyboard opens but the textarea is not focussed.
Read more >
HTML input fields does not get focus when clicked
when i click it the field does not get the focus. i can access the field via pressing the "tab-key". It sounds like...
Read more >
Focusing: focus/blur - The Modern JavaScript Tutorial
The focus event is called on focusing, and blur – when the element loses the focus. Let's use them for validation of an...
Read more >
Focus management and inert | CSS-Tricks
Interactive elements that can receive keyboard focus (such as the <button> element) don't need to have the tabindex attribute applied to them.
Read more >
Forms in HTML documents - W3C
The INPUT element creates a single-line input control and the TEXTAREA element creates a multi-line input control. In both cases, the input text...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found