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

UI element at end of blot #73

Closed
alecgibson opened this issue Jun 18, 2019 · 5 comments
Closed

UI element at end of blot #73

alecgibson opened this issue Jun 18, 2019 · 5 comments

Comments

@alecgibson
Copy link
Contributor

The latest parchment supports having a UI element at the start of a blot (eg for list items). Would it be acceptable to submit a pull request that adds support for these elements at the end of a blot? Our particular use case is adding a newline character to the end of a Block. At the moment we fudge this manually, but manipulating the DOM outside of Quill can be a little hairy, and it would be nicer if we could work with Quill rather than against it.

@jhchen
Copy link
Member

jhchen commented Jun 21, 2019

The ui element is still not rigorously tested and I would be reluctant to try to expand its usage. I'm not sure the use case you are describing is what it was designed for either though. Can you explain more about the newline + Block scenario?

@alecgibson
Copy link
Contributor Author

We're working on a track changes feature for showing the changes a user has made to a document. Part of this is showing them when they've inserted a paragraph break.

We're doing this by showing a "return" character at the end of the block. In theory this could be done with a pseudoelement, but we'd quite like for it to be a span so that we can underline it when the user selects the change (as in the screenshot). So we're currently adding this span manually, and also having to make sure it stays at the end of the Block if the contents of the paragraph change.

The character is purely for UI, and should not be considered part of the document, or be able to be interacted with. It also belongs conceptually one-to-one with a block. In these ways, it feels a lot like the existing UI elements in lists.

Screen Shot 2019-06-21 at 08 11 48

It could be that the UI elements don't quite fit this bill - I haven't dug into them in depth yet - hence the exploratory issue.

Do you think this is something that would be worth adding to core Quill? (Obviously if not, we'll just extend however we see fit with subclasses - just thought it might be a nice feature to add if other people have other use cases, eg status indicators at the end of a list item?)

(Side note on UI elements not being tested: I've noticed an issue with keyboard behaviour in lists in Quill. I've raised slab/quill#2651, although I'm still not sure if the solution is correct, so it'd be good to get thoughts on that when you have time, please!)

@jhchen
Copy link
Member

jhchen commented Jun 24, 2019

Do you think this is something that would be worth adding to core Quill?

To be clear "this" is something that exists in Quill's DOM purely for display and does not represent content?

The list issue you noted is an example of why the ui node is still needs to be tweaked and tested.

@alecgibson
Copy link
Contributor Author

To be clear "this" is something that exists in Quill's DOM purely for display and does not represent content?

Yes, I suppose I was talking about having something at the end of the blot, but perhaps it would be better to think more "generally".

@quill-bot
Copy link

Closing inactive issue.

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