Clicking on a disabled option of select[multiple] doesn't focus the select menu

Here is the pen: https://codepen.io/Supersudo/pen/abZMvmJ?editors=1000

In Firefox, the select menu is focused when when the disabled option was clicked. In Chrome, it doesn’t focus unless you click around the disabled option.

Is there a way to focus the select menu even if the clicked option is disabled?

If you could focus on it it wouldn’t be disabled.

Only option is disabled, I want to focus the whole select menu.

I’m not sure of the consequences but you could try pointer-events:none on the disable option which should let the click pass through to the select.

SCSS

select[multiple] {
	height: calc(1.5em + 0.75rem + 2px) !important;
	position: relative;
	
	option {
		padding: 0.375rem 0.75rem;
	}
 option[disabled]{pointer-events:none;}
}

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.