Go to file
jordi fita mas f945051f4a Remove document and window event handlers when removing custom elements
I realized that the event handlers that i was setting when creating the
tags input and the multi-select controls were not removed just because
these elements are no longer in the document, and kept firing again and
again.

I no longer can use an anonymous function, because removeEventListener
would not match it with the one passed to addEventListener.  I also have
to bind the handler to `this` in order to keep having access to the
object, and, again, can not do it in the call to addEventListener, or
i would get a different function each time.

I added the check to see if the element is connected inside the
connectedCallback because the documentation warns that this callback
“may be called once your element is no longer connected”[0], and i
understood it to mean that the connected and disconnected callbacks
could be called our of order, thus it would be possible to add event
listeners that would not be removed—again.

I am not actually sure where i have to do the same for the rest of the
“internal” events.

[0]: https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks
2023-04-10 00:05:29 +02:00
cmd/numerus Implement login cookie, its verification, and logout 2023-01-17 20:58:13 +01:00
debian Convert invoices to PDF with WeasyPrint 2023-02-26 17:26:09 +01:00
demo Replace tag relations with array attributes 2023-04-07 21:31:35 +02:00
deploy Replace tag relations with array attributes 2023-04-07 21:31:35 +02:00
pkg Replace tag relations with array attributes 2023-04-07 21:31:35 +02:00
po Improve translations to avoid from and to date confusion 2023-03-30 11:06:19 +02:00
revert Replace tag relations with array attributes 2023-04-07 21:31:35 +02:00
test Replace tag relations with array attributes 2023-04-07 21:31:35 +02:00
verify Replace tag relations with array attributes 2023-04-07 21:31:35 +02:00
web Remove document and window event handlers when removing custom elements 2023-04-10 00:05:29 +02:00
.gitignore Ignore IntelliJ’s project files 2023-01-30 16:42:15 +01:00
COPYING Rename LICENSE to COPYING 2023-01-15 04:08:35 +01:00
Makefile Rename extension of templates to .gohtml 2023-01-30 16:48:21 +01:00
go.mod Properly register array and composite PostgreSQL types with pgtype 2023-02-20 11:42:21 +01:00
go.sum Fix use of API methods not available in Go 1.16 2023-02-13 10:32:26 +01:00
sqitch.conf Setup authentication schema and user relation 2023-01-13 20:30:21 +01:00
sqitch.plan Replace tag relations with array attributes 2023-04-07 21:31:35 +02:00