UBERF-5357 (#4571)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-02-07 21:26:06 +06:00 committed by GitHub
parent e23d587033
commit 7b61f3d652
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 9 additions and 7 deletions

View File

@ -44,13 +44,15 @@ class FocusManagerImpl implements FocusManager {
} }
next (inc?: 1 | -1): void { next (inc?: 1 | -1): void {
if (this.elements.length === 0) return
const current = this.elements[this.current] const current = this.elements[this.current]
if (!(current?.canBlur?.() ?? true)) { if (!(current?.canBlur?.() ?? true)) {
return return
} }
while (true) { for (let index = 0; index < this.elements.length; index++) {
this.current = this.current + (inc ?? 1) this.current = this.current + (inc ?? 1)
if (this.elements[Math.abs(this.current) % this.elements.length].focus()) { const el = this.elements[Math.abs(this.current) % this.elements.length]
if (el?.focus()) {
return return
} }
} }

View File

@ -35,7 +35,7 @@
$: selectedPriority = value.priority $: selectedPriority = value.priority
const changePriority = async (newPriority: IssuePriority | undefined) => { const changePriority = async (newPriority: IssuePriority | undefined) => {
if (!isEditable || newPriority === undefined || value.priority === newPriority) { if (!isEditable || newPriority == null || value.priority === newPriority) {
return return
} }

View File

@ -57,7 +57,7 @@
} }
const changePriority = async (newPriority: IssuePriority | undefined) => { const changePriority = async (newPriority: IssuePriority | undefined) => {
if (!isEditable || newPriority === undefined || value === newPriority) { if (!isEditable || newPriority == null || value === newPriority) {
return return
} }

View File

@ -56,7 +56,7 @@
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
const changeStatus = async (newStatus: Ref<IssueStatus> | undefined, refocus: boolean = true) => { const changeStatus = async (newStatus: Ref<IssueStatus> | undefined, refocus: boolean = true) => {
if (!isEditable || newStatus === undefined || value.status === newStatus) { if (!isEditable || newStatus == null || value.status === newStatus) {
return return
} }

View File

@ -39,9 +39,9 @@
<!-- svelte-ignore a11y-no-static-element-interactions --> <!-- svelte-ignore a11y-no-static-element-interactions -->
<div class="menu-item" on:click={() => dispatch('close', 2)}> <div class="menu-item" on:click={() => dispatch('close', 2)}>
<BooleanPresenter value={false} /> <BooleanPresenter value={false} />
{#if !value} {#if withoutUndefined ? !value : !value}
<div class="check"> <div class="check">
<CheckBox checked={!value} kind={'primary'} /> <CheckBox checked={withoutUndefined ? !value : !value} kind={'primary'} />
</div> </div>
{/if} {/if}
</div> </div>