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.

defaultHighlighted prevents auto-highlighting on search

See original GitHub issue

If you specify a value for defaultHighlighted, that option remains highlighted even when it’s been filtered out. For example, if you apply defaultHighlighted="New York" to the first example on the “Action handling” page of the docs, it highlights New York by default: image

But then if you start typing, it filters but doesn’t highlight the first match: image

You then need to either click an option or press the down arrow to select one - pressing enter will select the defaultHighlighted item even though it’s not visible, and pressing tab will leave the power-select without changing the current selection.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cibernoxcommented, Apr 11, 2018

For system wide config this may be helpful: http://ember-power-select.com/cookbook

1reaction
cibernoxcommented, Apr 11, 2018

Because that’s not a helper returning a function. You want this:

{{#power-select ... efaultHighlighted=(pw-default-highlight) as |opt|}}

and the helper returns a function

import { helper } from '@ember/component/helper';
export function pwDefaultHighlight(params) {
  return function() {
    if (params.results.length > 0) {
      return params.highlighted = params.results[0];
    }
  }
}
export default helper(pwDefaultHighlight);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Word auto-highlighting, how to make it STOP!
I'm trying to highlight a single word or some part of a word for cut&paste operations and Word auto-highlights the whole line and...
Read more >
Correct answer: How to stop the auto highlighting of key words ...
Correct answer: How to stop the auto highlighting of key words/phrases when typing a text message? ... Let's gather a few clues to...
Read more >
Solved: Searching for words and then Auto-highlighting (ye...
Solved: Hi, I am able to search a document for multiple words with the Find Option; however, I cannot figure out how to...
Read more >
Prevent email clients from auto-highlighting email addresses ...
I am looking for a CSS/HTML workaround to prevent email clients such as Outlook and Apple Mail from auto-highlighting an email address in...
Read more >
SearchHighlighting - Highlighting of searches via star, auto ...
SearchHighlighting : Highlighting of searches via star, auto-highlighting. script karma, Rating 40/12, Downloaded by 3112, Comments, bugs, improvements, Vim ...
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