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.

Focus on highlighted list item

See original GitHub issue

Hi, I’m trying to focus on the highlighted list item when pressing the down or up arrow key. I use to have a long list of users to mention and I want to auto scroll the list down next to the highlighted item. I’ve tried to add this quill keyboard handler for down arrow but it didn’t work:

down: {
        key: 40,
        handler: function(range: any, context: any) {      
          const mentionListItem: any = document.querySelector('.ql-mention-list-item.selected');
          const focusList: any = findDOMNode(mentionListItem).nextSibling;
          // TODO: know how to focus list item
          mentionListItem.focus();
          return true;
        }
      }

I guess because we already return false to the downHandler function of quill-mention module? Is there a way we focus the item to scroll it down to the remaining items of the list? Like in this example .

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
abelski21commented, Mar 28, 2018

Got it. Thanks! Here’s my pull request #8

0reactions
MadSpindelcommented, Mar 27, 2018

@abelski21 You need to fork the branch first. Then you need to make a pull request from your branch to this master branch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Highlight of ListView items without setting the focus [duplicate]
I just want one item - same as it is typed in the textBox - to be highlighted .. but this sounds to...
Read more >
Displaying highlight on selected item when control is not ...
My problem is that items in the listview's selectedItems collection only appear highlighted when the listview control has focus. Thus, if you ...
Read more >
Use a rule to select/highlight a row in a List View | Community
Hi,is there a way to use a rule to highlight/select a specific row in a List View? I know the ID of the...
Read more >
retain blue background on listview selected item when focus ...
When I select an item in a listview, the selected item's background turns blue. When I click on a button on the same...
Read more >
DropdownList highlighted item using keyboard not in focus
Hi, When we press key n on keyboard dropdown list is highlighting first item with n key but it's not in focus we...
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