Skip to content

Commit

Permalink
@loaded and @error events are firing only once
Browse files Browse the repository at this point in the history
Resolved Text component @loaded and @error events firing only
once with reactive arguments also

Signed-off-by: suresh-gangumalla <[email protected]>
  • Loading branch information
suresh-gangumalla committed Oct 18, 2023
1 parent a928b87 commit d3ad81e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ const Element = {

if (props['@loaded']) {
const event = props.__textnode ? 'textLoaded' : 'txLoaded'
this.node.once(event, (el, { width: w, height: h }) => {
this.node.on(event, (el, { width: w, height: h }) => {
props['@loaded']({ w, h }, this)
})
}

if (props['@error']) {
const event = props.__textnode ? 'textFailed' : 'txFailed'
this.node.once(event, (el, error) => {
this.node.on(event, (el, error) => {
props['@error'](error, this)
})
}
Expand Down

0 comments on commit d3ad81e

Please sign in to comment.