invalidateSemantics

Function

Common
fun SemanticsModifierNode.invalidateSemantics() = requireLayoutNode().invalidateSemantics()

Invalidate semantics associated with this node. This will reset the SemanticsConfiguration associated with the layout node backing this modifier node, and will re-calculate it the next time the SemanticsConfiguration is read.

Semantics are automatically invalidated when backed by mutable state, or if the hierarchy is recomposed. In these cases SemanticsModifierNode.applySemantics is called and the latest semantics values are applied. However in cases where semantics properties are not backed by mutable state objects, a change to the semantic property will not trigger SemanticsModifierNode.applySemantics. This function can be used to manually invalidate semantics to ensure that SemanticsModifierNode.applySemantics will be called the next time the SemanticsConfiguration is read.