Skip to content

Commit

Permalink
attempt to fix CI
Browse files Browse the repository at this point in the history
replace Array function with a for loop
  • Loading branch information
seanpdoyle committed Mar 27, 2021
1 parent 4d7f686 commit fc566b2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/@stimulus/core/src/target_observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ export class TargetObserver implements TokenListObserverDelegate {
}

private containsDescendantWithToken(element: Element, content: string): boolean {
const targetTokens = parseTokenString(element.getAttribute(this.attributeName) || "", element, this.attributeName)
let containsTargetToken = false

return targetTokens.map(token => token.content).includes(content) && this.context.element.contains(element)
for (const token of parseTokenString(element.getAttribute(this.attributeName) || "", element, this.attributeName)) {
containsTargetToken = containsTargetToken || token.content == content
}

return containsTargetToken && this.context.element.contains(element)
}

private dispatchCallback(method: string, element: Element) {
Expand Down

0 comments on commit fc566b2

Please sign in to comment.