From b176784f31a7bc4b55e40cec368dff571c4fb991 Mon Sep 17 00:00:00 2001 From: Lloyd Lobo Date: Thu, 25 Apr 2024 22:17:21 +0530 Subject: [PATCH] docs: fix `this` binding in `onClick .then` handler with arrow function (#2373) docs: fix `this` binding in onClick .then handler with arrow fn Update the `.then()` handler in the `onClick` attribute to use an arrow function instead of a traditional `function(arg)` expression. This fixes the `this` binding within the lexical scope, ensuring that `this` is bound to the `button` instead of the `window` and resolving the issue. Fixes/Closes issue #2257 --- www/content/examples/confirm.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/content/examples/confirm.md b/www/content/examples/confirm.md index c0e74546..96e7b665 100644 --- a/www/content/examples/confirm.md +++ b/www/content/examples/confirm.md @@ -17,7 +17,7 @@ the [`htmx:confirm`](@/events.md#htmx:confirm) event.