korlibs / korlibs/korge

Weird behavior for certain buttons

Open
#403 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
3k
Forks
148
Avg merge
13h 44m
Merged PRs (30d)
1

Description

For the following code:
```
suspend fun main() = Korge() {

repeat(12) { //only happens for 12
text("Test")
}

val aText = text("")

uiButton(btnSize, btnSize) {
alignBottomToBottomOf(this@Korge, btnSize / 3)
alignLeftToLeftOf(this@Korge, btnSize / 3)
text = "test"
onClick {
aText.text = "Test"
}
}
uiButton(btnSize, btnSize) {
alignBottomToBottomOf(this@Korge, btnSize / 3)
alignRightToRightOf(this@Korge, btnSize / 3)
text = "test"
onClick {
aText.text = ""
}
}
}
```
clicking the button changes how the first button look
![Screenshot_20211110_005824](https://user-images.githubusercontent.com/36378873/141024817-2de2c5c2-c4a6-40f0-aee4-11cd243480dd.png)
![Screenshot_20211110_005832](https://user-images.githubusercontent.com/36378873/141024822-37e461e6-a654-4a29-b016-79b7f307870a.png)

I tested this on Windows and Linux(arch with kde on x11) with jvm and js targets(Firefox and chromium), all with AMD graphics.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the supplied suspend fun main Korge example with repeat(12), two uiButton calls, and clicks on both buttons. Compare the first button before and after updating aText across the reported JVM and JS targets. Done means clicking either button no longer changes the first button's appearance unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.