{"record":{"id":"aed089c1a4d84674","repo":"basecamp/trix","slug":"this-browser-does-not-support-the-name-property-f","errorCode":null,"errorMessage":"This browser does not support the .name property for trix-editor elements.","messagePattern":"This browser does not support the \\.name property for trix-editor elements\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/trix/elements/trix_editor_element.js","lineNumber":301,"sourceCode":"\n    const label = findClosestElementFromNode(this.element, { matchingSelector: \"label\" })\n    if (label) {\n      if ([ this.element, null ].includes(label.control)) {\n        labels.push(label)\n      }\n    }\n\n    return labels\n  }\n\n  get form() {\n    console.warn(\"This browser does not support the .form property for trix-editor elements.\")\n\n    return null\n  }\n\n  get name() {\n    console.warn(\"This browser does not support the .name property for trix-editor elements.\")\n\n    return null\n  }\n\n  set name(value) {\n    console.warn(\"This browser does not support the .name property for trix-editor elements.\")\n  }\n\n  get disabled() {\n    console.warn(\"This browser does not support the [disabled] attribute for trix-editor elements.\")\n\n    return false\n  }\n\n  set disabled(value) {\n    console.warn(\"This browser does not support the [disabled] attribute for trix-editor elements.\")\n  }\n","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/basecamp/trix/blob/470040131122bd44e269b4de0f2e9557f90ec994/src/trix/elements/trix_editor_element.js#L283-L319","documentation":"The name getter on trix-editor warns and returns null in browsers that don't support reflecting the name property for form-associated custom elements. The attribute/property API is unavailable, so Trix degrades gracefully with a console warning.","triggerScenarios":"Reading editorElement.name in a browser without the required custom element form-association support (e.g. no ElementInternals/name reflection), while relying on it for form submission wiring.","commonSituations":"Legacy browser support matrices; automated tests on old engines; code copying patterns from native inputs (input.name) onto the custom element.","solutions":["Read the attribute instead: editor.getAttribute(\"name\").","Target browsers supporting form-associated custom elements or add a polyfill.","Update Trix; newer versions may broaden support.","Treat null as \"unsupported\" and fall back to attribute-based naming."],"exampleFix":"// before\nconst fieldName = editor.name\n// after\nconst fieldName = editor.name || editor.getAttribute(\"name\")","handlingStrategy":"fallback","validationCode":"const name = editor.name ?? editor.getAttribute(\"name\")\nif (name == null) console.warn(\"trix-editor name unavailable in this browser\")","typeGuard":"function getEditorName(editor) {\n  return editor.name != null ? editor.name : editor.getAttribute(\"name\")\n}","tryCatchPattern":"let name = null\ntry {\n  name = editor.name\n} catch (e) {\n  name = null\n}\nif (name == null) name = editor.getAttribute(\"name\")","preventionTips":["Prefer reading the name attribute; it works in all browsers.","Detect null returns and log browser capability issues to telemetry.","Verify browser support matrix includes form-associated custom elements."],"tags":["browser-compatibility","dom","trix"],"backgroundTag":"unsupported-browser-feature","analyzedSha":"470040131122bd44e269b4de0f2e9557f90ec994","analyzedAt":"2026-09-02T10:19:15.878Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T16:17:10.729Z"}