All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.mvysny.kaributesting.v10.ElementUtils.kt Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
package com.github.mvysny.kaributesting.v10

import com.vaadin.flow.component.Component
import com.vaadin.flow.component.ComponentUtil
import com.vaadin.flow.dom.DomEvent
import com.vaadin.flow.dom.Element
import com.vaadin.flow.internal.nodefeature.ElementListenerMap

/**
 * Fires a DOM [event] on this element.
 */
public fun Element._fireDomEvent(event: DomEvent) {
    node.getFeature(ElementListenerMap::class.java).fireEvent(event)
}

/**
 * Returns all components that are closest to [this] element.
 */
public fun Element._findComponents(): List {
    val components = mutableListOf()

    ComponentUtil.findComponents(this) {
        components.add(it)
    }

    return components
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy