-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Labels
area:coreA bug/feature for the core code-input.js/code-input.css filesA bug/feature for the core code-input.js/code-input.css filesenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerspriority:medium
Milestone
Description
I'm thinking:
<code-input language="javascript" placeholder="JavaScript code, highlighted"><textarea data-code-input-fallback placeholder="JavaScript code, not highlighted">// This is a demo file
console.log("Hello, World!");
</textarea></code-input>If this syntax (including the data-code-input-fallback) conflicts with anyone's usage so far I'll be incredibly surprised; if HTML is written inside a code-input and contains a textarea[data-code-input-fallback], the <s can be replaced with <s.
Very little code: just detect the textarea, transfer its value to the code-input value if it's present, and transfer textareaSyncAttributes to the code-input if the code-input doesn't already have them. CSS must be updated to override invisible text in textarea[data-code-input-fallback] - maybe always make it black on white.
This is useful because code-input can be used with HTML forms and no extra JavaScript.
Metadata
Metadata
Assignees
Labels
area:coreA bug/feature for the core code-input.js/code-input.css filesA bug/feature for the core code-input.js/code-input.css filesenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomerspriority:medium