Status Update
Comments
an...@google.com <an...@google.com>
lp...@google.com <lp...@google.com> #2
This is probably happening because there are multiple instances of DataStore active. You should consider managing the DataStore as a singleton. See the attached bug for more info.
Description
Jetpack Compose release version: 1.0.0-beta06 and 1.0.0-beta07 Android Studio Build: Arctic Fox 2020.3.1 Canary 15
This is a weird one, it looks like a compiler bug but I'm not so sure:
I'm attaching a demo project reproducing this issue. There are two texts taking the whole screen. The first one is rendering an
Item
composable with its data coming from a data class created in the compose module (app). The second one is using a data class coming from another module (data).When you long press the first item, the ripple effect is shown and half the screen turns grayish for a moment, then it turns blue once the long press event is fired and the selection state is toggled. Once you lift the finger, you can see a small change on that blue because the grayish color from the ripple is removed. Then if you repeat this procedure, the item will be unselected and the background will return to white.
When you do the same thing on the second item, you'll notice there's no difference when you lift the finger, and when you repeat this step, the background is still gray, not white.
However, when you make some change to the project, the background of the first text will behave as the second one, and will only get fixed if you do Build > Clean project.
The issue 186223077 but in this case it does not involve a dialog or popup.
isSelected
property of the composable is causing this behavior. If you remove it from the composable it won't do that but that's not desirable. It looks like the Cancel/Up event is not fired for some reason. This might be related toI'm also attaching a small video to show the bug.