Fix button disabling

This commit is contained in:
Cram42 2022-11-10 19:24:02 +08:00
parent a4b93d4bbd
commit 7108156072

View file

@ -318,19 +318,19 @@
<div class="l2fd-buttonbar" style="grid-area: options-buttons">
<button
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) shiftSelectedOption(-1)"
x-bind:class="{ 'disabled': !selectedOption || selectedOptionIndex == 0 }"
x-bind:class="{ 'disabled': !selectedField || !selectedOption || selectedOptionIndex == 0 }"
><i class="fa-solid fa-caret-up"></i></button>
<button
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) shiftSelectedOption(+1)"
x-bind:class="{ 'disabled': !selectedOption || selectedOptionIndex == selectedField.options.length - 1 }"
x-bind:class="{ 'disabled': !selectedField || !selectedOption || selectedOptionIndex == selectedField.options.length - 1 }"
><i class="fa-solid fa-caret-down"></i></button>
<button
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) addOption()"
x-bind:class="{}"
x-bind:class="{ 'disabled': !selectedField }"
><i class="fa-solid fa-plus"></i></button>
<button
x-on:click.prevent="if(!$event.target.classList.contains('disabled')) trashSelectedOption()"
x-bind:class="{ 'disabled': !selectedOption }"
x-bind:class="{ 'disabled': !selectedField || !selectedOption }"
><i class="fa-solid fa-trash"></i></button>
</div>
</div>