Netbox: Select2 - Able to Search without Clicking

Created on 10 Apr 2019  路  5Comments  路  Source: netbox-community/netbox

Environment

  • Python version: 3.6
  • NetBox version: 2.5.8

Proposed Functionality

On the select2 front of things, curious if there is a method to allow you to start typing without clicking into the drop down?

Would like to use the tab key to get to the field and then start typing. Just looking to use the mouse as little as possible, but to keep the select2 functionality.

I like the search functionality way better on Select2 and for that reason I can start to click on the drop down.

Previously you could tab say to the Tenant Group, and type out the letters for quick selection, then tab to the Tenant Name and start typing to get the Tenant selected.

Use Case

  • Less movement from keyboard to mouse while entering new device information
  • Consistent movement between fields
  • To keep the functionality of Netbox and to possible use without a mouse

Database Changes

I don't know of any

External Dependencies

  • Unsure

All 5 comments

I assume this is a limitation of the Select2 package, so I'm going to close this out. If someone can dig into it and prescribe a specific change that we can make to accommodate the requested functionality, I'll be happy to reopen this.

@jeremystretch Looks like SO has a nice solution we might be able to piggy back on (second solution):

https://stackoverflow.com/questions/32728774/how-to-focus-select2-pressing-enter-key

This has also been a pet-peeve of mine. I can dig into this more.

Re-opening this to allow further exploration, but let's bear in mind the value-to-effort ratio: I don't want to introduce a hundred lines of Javascript that we must maintain in perpetuity just to save a mouse click.

I think I have found a work around on the Click2, that probably satisfies this. If you highlight the field you are on, press [enter] and it will bring up the search. @DanSheps - so maybe a user education piece on Select2 more than anything else.

Testing in the latest build, you no longer need to press enter to start searching. I am going to close this out for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markve-sa picture markve-sa  路  4Comments

bellwood picture bellwood  路  4Comments

markve-sa picture markve-sa  路  4Comments

billyzoellers picture billyzoellers  路  3Comments

luto picture luto  路  3Comments