josdejong/svelte-jsoneditor

How to add associated label to textarea

Open

#451 创建于 2024年6月14日

在 GitHub 查看
 (9 评论) (0 反应) (0 负责人)TypeScript (149 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (1,237 star)
PR 合并指标
 (PR 指标待抓取)

描述

Hey! i am wondering if there is anyway to add additional attributes to editor and menus. Most importantly, I would like to add a label element for the rendered editor (the div with the role of textbox) for accessibility reasons. I would be able to do so if this element had a unique id but i do not see one on the rendered element. Is there a way to add a label that is bound to this textbox, or a way to add additional attributes (like id or even aria attributes) to the rendered elements?

<div spellcheck="false" autocorrect="off" autocapitalize="off" translate="no" contenteditable="true" style="tab-size: 4;" class="cm-content cm-lineWrapping" role="textbox" aria-multiline="true" data-language="json" aria-autocomplete="list"><div class="cm-activeLine cm-line" style="padding-left: calc(2ch + 6px); text-indent: calc(-2ch + 0px);">{}</div></div>

贡献者指南