Reword HTMLElement cloneNode remark for clarity
This commit is contained in:
@@ -85,7 +85,7 @@ export abstract class Table<TRow extends object> {
|
||||
|
||||
return keys.map(key => ({
|
||||
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
|
||||
}));
|
||||
}
|
||||
@@ -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
|
||||
* 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
|
||||
* el.cloneNode(true) does not keep event listeners, so if event listeners are used its best
|
||||
* generate any many needed.
|
||||
* el.cloneNode(true) does not keep event listeners, so if event listeners are used it is best
|
||||
* to generate a fresh element for each row that needs one.
|
||||
*/
|
||||
protected createPopulatedRow(data: TRow): HTMLTableRowElement {
|
||||
const row = document.createElement("tr");
|
||||
@@ -226,7 +226,7 @@ export abstract class Table<TRow extends object> {
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
return this.messageEl;
|
||||
|
||||
Reference in New Issue
Block a user