Adding multiple custom client IP addresses in the web interface resets the dropdown, resulting in confusion

Problem with Beta 5.0:
On the Group Management > Clients page, it is annoying to add multiple custom client IP addresses because the dropdown changes from custom whenever a new client is added, though the text box remains enabled. For example:

  1. Open the page.
  2. Click "Custom, specified below..." in the dropdown. The text box below should become enabled.
  3. Type an IP address, and add it.
  4. Now, type another IP address into the same (still enabled text box) and add it.

You'll notice that a different IP address is added when you do step 4 other than the one you typed. If you're not looking carefully, you'll miss that after step 3, the dropdown has selected the first item in the list instead of sticking with custom, yet the custom IP text box is still enabled, which is misleading to the user. Thus, after every custom client you add, you must change the dropdown back to "Custom, specified below..."

I feel that the best solution to this is to keep the dropdown at "Custom" if a new custom client IP address is added instead of unexpectedly changing the selection.

Here's a quick fix for devs
line 20 in /var/www/html/admin/scripts/pi-hole/js/groups-clients.js
add
var customWasSelected = (sel.val() === "custom");

then in line 44
if (customWasSelected) { sel.val("custom"); }

Make a pull request for it GitHub - pi-hole/AdminLTE: Pi-hole Dashboard for stats and more

Thanks for mentioning this. I implemented @chillax's suggestion almost 1:1.

edit This has already been merged into the beta.

3 Likes