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

"Magic" (read: auto-detected) Editable transforms, merging, focus #878

Closed
aduth opened this issue May 23, 2017 · 2 comments
Closed

"Magic" (read: auto-detected) Editable transforms, merging, focus #878

aduth opened this issue May 23, 2017 · 2 comments
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Question Questions about the design or development of the editor.

Comments

@aduth
Copy link
Member

aduth commented May 23, 2017

Related: #769 (comment)

A good deal of effort has been placed in allowing granular control over focusing, transforming, and merging blocks containing Editable content. This has also surfaced some concern over the shape of an Editable attribute value (#771) since a developer would need to be conscious of it in implementing their transforms.

In an effort to keep things simple for block implementers, we should consider eliminating this granular control in lieu of "smart" detection of Editable content, even if this means sacrificing some behaviors like merging two blocks of distinct types, moving focus within a block in response to key commands (like backspacing a caption to a quote's content), etc.

This is admittedly something of a dream goal. Particularly, it could be challenging to know where in a block an editable value exists, and how to map that value to the attribute of another block. This can be known in the case of merging two text blocks by iterating over attributes keys to find children matchers, but this same approach would fall apart for transforming between block types (e.g. when transforming a text block to a quote block, how do we know the Editable value should be assigned to the quote's text and not its caption?).

I sense the bulk of the automated behavior could occur by a direct communication channel between VisualEditorBlock and Editable using React's context feature to transparently pass props and callbacks to the rendered Editable.

@youknowriad
Copy link
Contributor

Should we close this now that we removed focus and setFocus or do you want to keep it to add some more "magic" :)

@aduth
Copy link
Member Author

aduth commented Feb 15, 2018

I think it can be closed, yes. Some automation with the transforms would be nice, but not blocking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

2 participants