Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add contenteditable attribute for SVG text elements #332

Open
AmeliaBR opened this issue Jul 14, 2017 · 1 comment
Open

Add contenteditable attribute for SVG text elements #332

AmeliaBR opened this issue Jul 14, 2017 · 1 comment

Comments

@AmeliaBR
Copy link
Contributor

The HTML contenteditable attribute makes it easy to make interactive inputs out of styled text. It would be very useful to have it in SVG, too.

Presently, all browsers I've tested support editable SVG text in inline SVG, where a parent HTML element is set to contenteditable. However, it is not very useful in practice:

  • You cannot control which elements within the SVG are editable.
  • If the user deletes the initial text content, they delete the SVG elements, too (or at the very least, end up with the text input cursor adding content beside the markup instead of inside it).

Microsoft Edge supports the contenteditable attribute directly on SVG <text> elements in inline SVG, but most other browsers don't.

There are issues and edge cases with contenteditable that still need to be resolved in the HTML specs, particularly re accessibility. However, none of those issues would get any worse by extending the functionality to SVG (so long as the SVG definition refers to HTML & therefore automatically stays in sync).

The feature only applies to interactive environments, so there would be no implementation cost to most non-browser SVG environments.

@boggydigital
Copy link
Contributor

Not blocking updated 2.0 CR publication - assigning 2.1 WD milestone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants