Skip to content

Commit

Permalink
TextComponent: Fix click and hover events not being put in the right …
Browse files Browse the repository at this point in the history
…object
  • Loading branch information
camnwalter authored and mattco98 committed Mar 20, 2024
1 parent f401f3d commit 5451573
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,18 @@ class TextComponent private constructor(
style_.clickEvent?.let { event ->
if (event.action != null) {
val clickEvent = NativeObject()
clickEvent.put("action", it, event.action.asString())
clickEvent.put("value", it, event.value)
clickEvent.put("action", clickEvent, event.action.asString())
clickEvent.put("value", clickEvent, event.value)

it.put("clickEvent", it, clickEvent)
}
}
style_.hoverEvent?.let { event ->
if (event.action != null) {
val hoverEvent = NativeObject()
hoverEvent.put("action", it, event.action.asString())
hoverEvent.put("action", hoverEvent, event.action.asString())
event.getValue(event.action!!)?.let { value ->
hoverEvent.put("value", it, value)
hoverEvent.put("value", hoverEvent, value)
}

it.put("hoverEvent", it, hoverEvent)
Expand Down

0 comments on commit 5451573

Please sign in to comment.