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.

Input losing focus when wrapped into label

See original GitHub issue

Observed on Firefox 31 if the input that gets enhanced with typeahead is wrapped into a <label> tag it will focus and blur again right away.

Issue Analytics

  • State:open
  • Created 9 years ago
  • Reactions:1
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rgmcommented, Apr 23, 2015

My workaround is to back out be9114d after setting up the typeahead. That commit seems to be an IE8/IE9 fix and luckily we’re not supporting those:

// do typeahead setup, etc., to get it in the DOM, then
var $hint = $("scope>to>typeahead>input.tt-hint");
$hint
  .prop("readonly", false)
  .prop("disabled", true);

Thanks @ebi for the detective work. Nice find.

0reactions
SantzDesigncommented, Oct 14, 2017

Unbelievable there’s a bug like this! Drove me crazy for at least half an hour. 2014 when the issue has 1st been raised, still no fix? Sad.

To date, still broken, using Safari 11.0 (12604.1.38.1.7) on macOS Sierra (10.12.6).

Read more comments on GitHub >

github_iconTop Results From Across the Web

In React ES6, why does the input field lose focus after typing a ...
While using Chrome's Inspector, it looks like the whole form is being re-rendered instead of just the value attribute of the input field...
Read more >
focus-within - CSS: Cascading Style Sheets - MDN Web Docs
The :focus-within CSS pseudo-class matches an element if the element or any of its descendants are focused. In other words, it represents an ......
Read more >
css Archives - Coding Beauty
Keep label on top when non-empty input loses focus. There's one more thing we have to do. When you enter text in the...
Read more >
Focusing: focus/blur - The Modern JavaScript Tutorial
Losing the focus generally means: “the data has been entered”, so we can run the code to check it or even to save...
Read more >
Binded input loses focus on typing - Google Groups
The problem is that with every change to the model object the ng-repeat regenerates the whole array and so blurs your input box....
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