Fix: force redrawing the questions in a questionbox to avoid rendering artefacts and unselectable items
This commit is contained in:
parent
e7b7f2a09d
commit
f7e2dc7457
1 changed files with 10 additions and 4 deletions
|
@ -4,7 +4,7 @@
|
||||||
* The questions can either be shown all at once or one at a time (in which case they can be skipped)
|
* The questions can either be shown all at once or one at a time (in which case they can be skipped)
|
||||||
*/
|
*/
|
||||||
import TagRenderingConfig from "../../../Models/ThemeConfig/TagRenderingConfig"
|
import TagRenderingConfig from "../../../Models/ThemeConfig/TagRenderingConfig"
|
||||||
import { UIEventSource } from "../../../Logic/UIEventSource"
|
import { Store, UIEventSource } from "../../../Logic/UIEventSource"
|
||||||
import type { Feature } from "geojson"
|
import type { Feature } from "geojson"
|
||||||
import type { SpecialVisualizationState } from "../../SpecialVisualization"
|
import type { SpecialVisualizationState } from "../../SpecialVisualization"
|
||||||
import LayerConfig from "../../../Models/ThemeConfig/LayerConfig"
|
import LayerConfig from "../../../Models/ThemeConfig/LayerConfig"
|
||||||
|
@ -12,6 +12,7 @@
|
||||||
import Tr from "../../Base/Tr.svelte"
|
import Tr from "../../Base/Tr.svelte"
|
||||||
import Translations from "../../i18n/Translations.js"
|
import Translations from "../../i18n/Translations.js"
|
||||||
import { Utils } from "../../../Utils"
|
import { Utils } from "../../../Utils"
|
||||||
|
import { onDestroy } from "svelte"
|
||||||
|
|
||||||
export let layer: LayerConfig
|
export let layer: LayerConfig
|
||||||
export let tags: UIEventSource<Record<string, string>>
|
export let tags: UIEventSource<Record<string, string>>
|
||||||
|
@ -67,7 +68,12 @@
|
||||||
},
|
},
|
||||||
[skippedQuestions]
|
[skippedQuestions]
|
||||||
)
|
)
|
||||||
let firstQuestion = questionsToAsk.map((qta) => qta[0])
|
let firstQuestion: UIEventSource<TagRenderingConfig> = new UIEventSource<TagRenderingConfig>()
|
||||||
|
|
||||||
|
onDestroy(questionsToAsk.addCallback(qta => {
|
||||||
|
firstQuestion.setData(undefined)
|
||||||
|
firstQuestion.setData(qta[0])
|
||||||
|
}))
|
||||||
|
|
||||||
let answered: number = 0
|
let answered: number = 0
|
||||||
let skipped: number = 0
|
let skipped: number = 0
|
||||||
|
@ -144,7 +150,7 @@
|
||||||
<TagRenderingQuestion config={question} {tags} {selectedElement} {state} {layer} />
|
<TagRenderingQuestion config={question} {tags} {selectedElement} {state} {layer} />
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else if $firstQuestion !== undefined}
|
||||||
<TagRenderingQuestion
|
<TagRenderingQuestion
|
||||||
config={$firstQuestion}
|
config={$firstQuestion}
|
||||||
{layer}
|
{layer}
|
||||||
|
|
Loading…
Reference in a new issue