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

Text is not directly editable when selected #21

Open
Azeirah opened this issue Oct 7, 2015 · 2 comments
Open

Text is not directly editable when selected #21

Azeirah opened this issue Oct 7, 2015 · 2 comments

Comments

@Azeirah
Copy link

Azeirah commented Oct 7, 2015

Instead of having to input the desired string into the "text" attribute of a text element, it would be really nice if it was possible to type directly into the text symbol.

It would be especially great if you could edit a text field from a symbol like this, then we'd be able to create forms!

@electronicwhisper
Copy link
Collaborator

Yes, this would be fantastic. I think it might be a heavy endeavor.

Text, like all the other graphics, is currently rendered by a DOM Canvas. So to make an editor, we need to track the pixel positions of all the letters, render a "fake" blinking text cursor appropriately, and respond appropriately to keyboard input. This is all possible, but a good deal of work.

Marijn Haverbeke, author of CodeMirror, has done a lot of work with making "fake" text editors. There are probably useful ideas on his blog.

@joshuahhh
Copy link
Collaborator

https://github.com/danielearwicker/carota is a rich-text editor that runs in the canvas. At first glance, I thought it might be overkill, since it supports all the rich-text niceties rather than just "a line of single-styled text". But come to think of it, supporting rich text in diagrams really seems like a worthy goal to have.

Caveats: The project is not particularly active. I am not sure what integration would look like.

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

No branches or pull requests

3 participants