diff --git a/frontend/code/components/dropdown.ts b/frontend/code/components/dropdown.ts index 4d8ca195..93b61146 100644 --- a/frontend/code/components/dropdown.ts +++ b/frontend/code/components/dropdown.ts @@ -7,7 +7,6 @@ import { import { LayoutContext } from '../layouting'; import { pixelsPerRem, scrollBarSize } from '../app'; import { getTextDimensions } from '../layoutHelpers'; -import { ClickHandler } from '../eventHandling'; // Make sure this is in sync with the CSS const RESERVED_WIDTH_FOR_ARROW = 1.3; @@ -158,6 +157,10 @@ export class DropdownComponent extends ComponentBase { } private _onMouseDown(event: MouseEvent): void { + if (!this.state.is_sensitive) { + return; + } + // Not left click? if (event.button !== 0) { return; @@ -485,9 +488,17 @@ export class DropdownComponent extends ComponentBase { } if (deltaState.is_sensitive === true) { - element.classList.remove('rio-input-box-disabled'); + this.inputElement.disabled = false; + element.classList.remove( + 'rio-disabled-input', + 'rio-switcheroo-disabled' + ); } else if (deltaState.is_sensitive === false) { - element.classList.add('rio-input-box-disabled'); + this.inputElement.disabled = true; + element.classList.add( + 'rio-disabled-input', + 'rio-switcheroo-disabled' + ); } if (deltaState.is_valid === false) { diff --git a/frontend/css/style.scss b/frontend/css/style.scss index 8d3558fb..2b4026f7 100644 --- a/frontend/css/style.scss +++ b/frontend/css/style.scss @@ -459,9 +459,11 @@ textarea:not(:placeholder-shown) ~ .rio-input-box-label, .rio-dropdown { pointer-events: auto; - &, - & > input { - cursor: pointer; + &:not(.rio-disabled-input) { + &, + & > input { + cursor: pointer; + } } }