mirror of
https://github.com/outline/outline.git
synced 2026-11-20 21:23:06 +03:00
* Add missing JSDoc to exported members in app and server utils Documents all exported functions, classes, enums, and constants in app/utils and server/utils that were missing JSDoc, per the project documentation guidelines. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AsEQYA8zN813thxu7GjjzU * Use @returns tag to match codebase convention Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AsEQYA8zN813thxu7GjjzU --------- Co-authored-by: Claude <noreply@anthropic.com>
19 lines
650 B
TypeScript
19 lines
650 B
TypeScript
const inputs = ["input", "select", "button", "textarea"]; // detect if node is a text input element
|
|
|
|
/**
|
|
* Checks whether an element accepts text input, such as an input, textarea,
|
|
* select, or contenteditable element.
|
|
*
|
|
* @param element the element to check.
|
|
* @returns true if the element accepts text input.
|
|
*/
|
|
export default function isTextInput(element: Element): boolean {
|
|
return !!(
|
|
element &&
|
|
element.tagName &&
|
|
(inputs.indexOf(element.tagName.toLowerCase()) !== -1 ||
|
|
element.attributes.getNamedItem("role")?.value === "textbox" ||
|
|
element.attributes.getNamedItem("contenteditable")?.value === "true")
|
|
);
|
|
}
|