From bbecd2476ebddb2731065aad2f3895c5074c9ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 12 Jun 2022 03:11:08 +0200 Subject: Stop using with-label. --- static/components/vevent-edit.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'static/components') diff --git a/static/components/vevent-edit.ts b/static/components/vevent-edit.ts index ee368296..bf72678c 100644 --- a/static/components/vevent-edit.ts +++ b/static/components/vevent-edit.ts @@ -7,7 +7,7 @@ import { DateTimeInput } from './date-time-input' import { vcal_objects } from '../globals' import { VEvent, RecurrenceRule } from '../vevent' import { create_event } from '../server_connect' -import { to_boolean } from '../lib' +import { to_boolean, gensym } from '../lib' /* Edit form for a given VEvent. Used as the edit tab of popups. @@ -24,6 +24,14 @@ class ComponentEdit extends ComponentVEvent { let frag = this.template.content.cloneNode(true) as DocumentFragment let body = frag.firstElementChild! this.replaceChildren(body); + + for (let el of this.querySelectorAll('[data-label]')) { + let label = document.createElement('label'); + let id = el.id || gensym('input'); + el.id = id; + label.htmlFor = id; + label.textContent = (el as HTMLElement).dataset.label!; + } } connectedCallback() { -- cgit v1.2.3