Auto focus on first form field

Hi Ilia,

Is it somehow possible to remove or disable the auto focus on first form field? This is in my opinion a really anoying thing! For example, if I open a user to change his information I click the field to change and starts writing, and when I look up at the screen again the "auto focus" has moved the focus to the first form field of the page and I have typed a part of it in the right field and the rest ended up in the first form field. This happends most of the time because all pages has a second or so to load, and the auto focus kicks in after the pageload is done. This means I always has to wait for some seconds before I start. It maybe feels like a small thing but it actually is really anoying to have to wait a while and not to be able to start working right away!

CentOS 7.4.1708, Webmin 1.872, Usermin 1.734, Virtualmin 6.02 Pro, Authentic Theme 19.09-beta4

Best regards, Leffe (Blueforce)

Closed (fixed)


Title: Auto focus on first form feald » Auto focus on first form field
Body: View changes
Ilia's picture
Submitted by Ilia on Mon, 02/12/2018 - 03:10

Leffe, hi.

I honestly don't how how can you be so fast to have the ability to focus in 200ms and even start typing but I agree, if it happened it would be very annoying. I have made a fix to make sure not to autofocus in case user is really fast, just like you! ;)


Force update the theme to the latest development version using theme configuration.

Ilia's picture
Submitted by Ilia on Mon, 02/12/2018 - 03:10

Status: Active » Closed (fixed)

Thanks Ilia,

Im not that fast, 200ms fast... but it would be cool to be that fast! smile I yestarday manually updated almost a hundred mail users for a customer and I had to wait (about 1-2 seconds) on every user for the red progress line to reach the end and the auto focus to kick in before doing anything,

I have updated the theme and auto focus is gone! Thanks!

I don't like the auto focus at all, it's better to manually "activate" a field when you need to. When activating a field automatically there are allways a bigger risk changing something by accident.

Thanks again Ilia!

Regards, Leffe

Ilia's picture
Submitted by Ilia on Mon, 02/12/2018 - 16:40

You're welcome.

Autofocus is not gone. It's just gotten smarter. Try not to do anything when the page has been loaded. ;)

I read that on your github, and I did try that, but no autofocus. So i thougth you hade come to your senses and removed the autofocus entirely! :)

And after your last post I cleared all browser caches and tried it again, same result...

I click on a user to get the "Edit user" window without doing nothing after the click, and still no autofocus, and that is absolutely fine with me! As I said before its better to activate a field when you actually need it, not by default.


Hi again Ilia,

I don't know what is going on really... but can you please fix, read remove, the form field autofocus! Today a was adding some virtual servers with a few aliases, and again the autofocus is doing a mess, this time i start to write and after about a second or two it removes the focus from my selected/active field, this time it dont move the focus to another field it just removes it! This is really anoying!

Please remove the whole autofocus thing, I really think this auto-select-activate a form field is bad thing, much more risk to actidently change things! And most of the time the autofocus is at no help, if you want to select another field you anyway has to click to select it before typing/editing. I don't know if the autofocus can select check boxes and radio buttons also, if so, that could lead to seroius problems!

In what scenario do you think the aoutofocus brings more positive than negative things?

Please remove the whole autofocus thing!

Best regards, Leffe (Blueforce)

Joe's picture
Submitted by Joe on Tue, 02/13/2018 - 19:55 Pro Licensee

This sounds bug-like, rather than a fundamental issue with auto-focus. It shouldn't happen long after the page is loaded. If it is, something is wrong somewhere. It should happen before you have any chance to make changes to the page.

Hi Joe,

Yes I agree, After Ilia changed the autofocus yesterday that function become some sort of "auto removal of focus" ;) and that kicks in after about 1-2 seconds. In that time you definately has started to write.

And as I said before... I can't find ANY possitive things with autofocus to first form field - can you?

Best regards, Leffe

When it's not working properly we completely agree, and the goal would be to fix that.

However, we've had a number of folks requesting that we auto-focus that first field. Our hope is to fix the issue you're seeing, and see if we can get that working in a more ideal way.

Hi Eric,

I can agree that the autofocus on first field kiks in IF the field is empty, in that case you probably are starting on a new "form" and probably starts on the top, in this case I to think it's ok. But if you open a already filled in form for editing or just to check things, then the autofocus should NOT kick in, first of all you "activate" a field for editing even if you just should check things, and if you are about to edit things, the autofocus probably has hit the wrong field.

It woud be nice to have a on-off setting in the theme config for this, because I know for a fact that auto activated fields always is in a bigger risk of accidental changes. In our own built CMS system we actually have a "activate form" button due to customers many "I didn't mean to change that".

And yes, for those starting on a "new" form there is one mouse click to save. But for those editin or checking there are no benifits, and for those editing or checking on a pad without a mouse there are MUCH more risk to change something without knowing, because a field acutomatically did activate.

Also, if I'm in Virtualmin and klick some link in the left menu and then drops the virtual server list the autofocus also kills that list, and you have to klick it again.

These are just my thoughts...

Best regards, Leffe

Ilia's picture
Submitted by Ilia on Wed, 02/14/2018 - 02:12

Honestly, this feature bothered me as well, I just didn't have enough of extra-force to fix it.

I bet it should be perfect now in 99% of cases.

For the future, please provide exact page, where you find the bug.

Hi Ilia,

Yes, so far it works great! And thanks for lissening to my ideas :) As allwas... You do a fantastic job!

I'll try to be more specific next time, this time it happend on several places so I thought it was a global thing.

Best regards, Leffe

Hi Ilia,

I think this works fine now so i'm closing this.


Hi Guys,

This issue is back after the latest updates! And the problem the same as in post #7.

If I go to Virtualmin tab, selects a virtual server, selects "Edit users" then click "Add a user to this server" and starts typing in the "Virtual domain user details" and after about a second the red progress bar at the top of the "frame" starts and goes approximately to the middle of the screen and then disappears. In the same time the focus is removed from the field i'm typing in, and if I keep on typing the focus pops up in the search field below "Services" in the left menu, and of course... my typing is ending up in the search field.

And the focus is often removed from the virtual server list, closing it, as I describes at the end in post #11


Ilia's picture
Submitted by Ilia on Sun, 04/08/2018 - 02:01

Leffe, thanks for reporting.

I'll double check it but I'm not sure how it could be back only now. This part of the code hasn't been changed ever since.

I'll make sure that autofocus respects userfocus.

Ilia's picture
Submitted by Ilia on Sun, 04/08/2018 - 13:57


It doesn't seem to be possible from looking at the code.

Anytime you make an action, like mouse click or keyboard keypress, or focusing a field - the autofocus is getting locked up.

You must not be seeing this issue.

Can you steadily reproduce it or it happens occasionally for you? What is your hardware?

Hi Ilia,

I really don't know why this is happening, but it does, and it only happen when the progress bar is taking a second or so to finish when clicking something. It feels like the focus thing is "restarted" when the progress bar finishes, and I have most certainly starting to write during that time. It does happen every time I'm logged in on the server, but I cant say it is happening everywhere in Webmin/Virtualmin.

I'm using a rather new HP desktop with Intel quad core and 8 GB ram, Windows 10 pro 64-bit, Super fast SSD, Firefox ESR and standard Firefox, everything running the latest versions.

I don't know if this can have something to do with the red loading line takin a second or so in many places when logged it on the server, I have the cache storage set to zero and everything flushed/cleared when closing Firefox, no third part cookies, and the other cookies only to selected URLs. This machine is a work computer and is ONLY used for working purposes.

I know you are making Authentic theme faster, but these page/data loadings still makes the theme slower than Virtualmin Framed Theme, maybe this can have something to do whit this issue.


Ilia's picture
Submitted by Ilia on Sun, 04/08/2018 - 15:53


What do you mean by these page/data loadings still makes the theme slower? You mean read progress on top? You can disable it in configuration.

The red progress is not connected to focus feature - those are independent parts.

I'd be very appreciated if you could provide the screencast.

I litteraly don't see how it could be happening.

Yes, i mean the read progress on top. And yes, Authentic is slower than Framed Theme, for instance, if I click "Users and Groups in Webmin/System the page is loaded in about 3 seconds in Authentic, and in Framed Theme it loads in less than a second, and its almost the same in the rest of the theme, not the times but the page loading is slower almost everywhere in Authentic. But the theme speed is no problem for me! I was just thinking if it maybe had something to do with the losing of focus, because the focus drops exactly in the same time as when the read progress is done, during the loading progress the focus is in the first field and i'm writing and exactly when the loading is done the focus drops from the field i'm writing in.

Where exactly do I disable the read progress?

Ok, they are not connected, but still the focus droped exactly when the read progress bar was done!

I'll try to make a screen cast. W10 has a built in feature for it.

I litteraly don't see how it could be happening.

Maybe so, but still it is happening, maybe it is something in my computer, but I actually don't think so. Because when it happened before you changed some thing and the behavior also changed at first, to like in post #9, and it's exactly the same now.


Ilia's picture
Submitted by Ilia on Tue, 04/10/2018 - 14:31

Leffe, I'm looking forward to video-screencast if possible please. You can share the link privately using my website.

Hi Ilia,

My computer don't have a gaming graphics card so the built-in the gaming feature in Win10 that can record screen casts wont run, I will try it on another of my computers.

I have been monitoring this the last days and it does look like this behavior kicks in after while working with the computer, maybe it is caused by my computer, because it feels like the behavior should be consequent all the time if it is a theme issue. But either way it is really annoying ;)

You mean read progress on top? You can disable it in configuration.

Where exactly do I disable the read progress?


Ilia's picture
Submitted by Ilia on Thu, 04/12/2018 - 14:19

Okay, will be looking forward to it.

Where exactly do I disable the red progress?

Theme Configuration/Global options -> Hide top progress bar Yes/No

Ilia's picture
Submitted by Ilia on Thu, 04/26/2018 - 04:30

Status: Active » Closed (fixed)