Coder Social home page Coder Social logo

Comments (2)

mgroth0 avatar mgroth0 commented on May 30, 2024

Something like this is occurring for me as well on Desktop.

I am running:

  • MacOS 14.5
  • Java 20
  • Kotlin 2.0.0-RC1
  • Compose 1.6.10
Click here to see stack trace

java.lang.IndexOutOfBoundsException: index: -707, size: 1
	at kotlin.collections.AbstractList$Companion.checkElementIndex$kotlin_stdlib(AbstractList.kt:108)
	at kotlin.collections.builders.ListBuilder.get(ListBuilder.kt:39)
	at androidx.compose.ui.platform.a11y.ComposeAccessible$ComposeAccessibleComponent.getAccessibleChild(ComposeAccessible.kt:337)
	at androidx.compose.ui.platform.a11y.ComposeAccessible$ComposeAccessibleComponent.getAccessibleAt(ComposeAccessible.kt:380)
	at androidx.compose.ui.platform.a11y.ComposeAccessible$ComposeAccessibleComponent.getAccessibleAt(ComposeAccessible.kt:381)
	at androidx.compose.ui.platform.a11y.ComposeSceneAccessible$ComposeSceneAccessibleContext.getAccessibleAt(ComposeSceneAccessible.kt:89)
	at java.desktop/sun.lwawt.macosx.CAccessibility$23.call(CAccessibility.java:501)
	at java.desktop/sun.lwawt.macosx.CAccessibility$23.call(CAccessibility.java:471)
	at java.desktop/sun.lwawt.macosx.LWCToolkit$CallableWrapper.run(LWCToolkit.java:701)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.executePrivileged(AccessController.java:778)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.base/java.security.AccessController.executePrivileged(AccessController.java:778)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

I first started seeing this after putting together a complex UI with a very large amount of code behind it (this was also shortly after updating to 1.6.10). I expect it will take me a while to extract out a reproducer. I can, however, easily reproduce the issue in my own app. It is non-deterministic; I have to try the same thing a few times before the exception is thrown.

from compose-multiplatform.

mgroth0 avatar mgroth0 commented on May 30, 2024

Well, I was totally wrong about this being hard to reproduce. It was actually fast and easy.

Reproducer:

  1. Launch app
  2. Hover mouse above one of the "world" texts
  3. Scroll down
  4. Move mouse to the right, above the empty space
  5. Click
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.Text
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application

fun main() {
    application {
        Window(
            onCloseRequest = ::exitApplication
        ) {
            LazyColumn {
                item {
                    Text("Hello")
                }
                item {
                    repeat(100) {
                        Text("World")
                    }
                }
            }
        }
    }
}
Click here to see stack trace

java.lang.IndexOutOfBoundsException: index: -1, size: 1
	at kotlin.collections.AbstractList$Companion.checkElementIndex$kotlin_stdlib(AbstractList.kt:108)
	at kotlin.collections.builders.ListBuilder.get(ListBuilder.kt:39)
	at androidx.compose.ui.platform.a11y.ComposeAccessible$ComposeAccessibleComponent.getAccessibleChild(ComposeAccessible.kt:337)
	at androidx.compose.ui.platform.a11y.ComposeAccessible$ComposeAccessibleComponent.getAccessibleAt(ComposeAccessible.kt:380)
	at androidx.compose.ui.platform.a11y.ComposeAccessible$ComposeAccessibleComponent.getAccessibleAt(ComposeAccessible.kt:381)
	at androidx.compose.ui.platform.a11y.ComposeSceneAccessible$ComposeSceneAccessibleContext.getAccessibleAt(ComposeSceneAccessible.kt:89)
	at java.desktop/sun.lwawt.macosx.CAccessibility$23.call(CAccessibility.java:501)
	at java.desktop/sun.lwawt.macosx.CAccessibility$23.call(CAccessibility.java:471)
	at java.desktop/sun.lwawt.macosx.LWCToolkit$CallableWrapper.run(LWCToolkit.java:701)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.executePrivileged(AccessController.java:778)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:747)
	at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
	at java.base/java.security.AccessController.executePrivileged(AccessController.java:778)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:744)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

from compose-multiplatform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.