Reword HTMLElement cloneNode remark for clarity

This commit is contained in:
CentreMetre
2026-06-14 21:45:04 +01:00
parent 27488dd1b3
commit b0f40dea5f

View File

@@ -85,7 +85,7 @@ export abstract class Table<TRow extends object> {
return keys.map(key => ({ return keys.map(key => ({
key, // Raw property name from TRow key, // Raw property name from TRow
headerValue: displayNamesAndOrder?.[key] ?? String(key), // The value of the th html element, with a nullish coalescing operator for if its null headerValue: displayNamesAndOrder?.[key] ?? String(key), // The value of the th html element, with a nullish coalescing operator for if it is null
type: typeof exampleObject[key], // The type of the column type: typeof exampleObject[key], // The type of the column
})); }));
} }
@@ -146,8 +146,8 @@ export abstract class Table<TRow extends object> {
* @remarks If a cell value is an HTMLElement it is appended to the cell. A DOM node can only * @remarks If a cell value is an HTMLElement it is appended to the cell. A DOM node can only
* exist in one place, so passing the same element instance to multiple rows moves it to the * exist in one place, so passing the same element instance to multiple rows moves it to the
* last row only. Pass a fresh element (or `el.cloneNode(true)`) per row. But keep in mind that * last row only. Pass a fresh element (or `el.cloneNode(true)`) per row. But keep in mind that
* el.cloneNode(true) does not keep event listeners, so if event listeners are used its best * el.cloneNode(true) does not keep event listeners, so if event listeners are used it is best
* generate any many needed. * to generate a fresh element for each row that needs one.
*/ */
protected createPopulatedRow(data: TRow): HTMLTableRowElement { protected createPopulatedRow(data: TRow): HTMLTableRowElement {
const row = document.createElement("tr"); const row = document.createElement("tr");
@@ -226,7 +226,7 @@ export abstract class Table<TRow extends object> {
/** /**
* Get the message element for the table. * Get the message element for the table.
* @return The HTMLElement thats used for showing messages. Or null if its not set. * @return The HTMLElement that is used for showing messages. Or null if i iss not set.
*/ */
getMessageElement(): HTMLElement | null { getMessageElement(): HTMLElement | null {
return this.messageEl; return this.messageEl;