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

Keyboard nav uses non-public properties in paste #833

Closed
rachel-fenichel opened this issue Jul 29, 2021 · 2 comments
Closed

Keyboard nav uses non-public properties in paste #833

rachel-fenichel opened this issue Jul 29, 2021 · 2 comments
Assignees
Labels
category: plugin Anything in the plugins folder cleanup internal type: bug Something isn't working
Milestone

Comments

@rachel-fenichel
Copy link
Collaborator

Category

  • Plugins

Component

keyboard-navigation

Describe the bug

The paste function directly accesses Blockly.clipboardXml_, Blockly.clipboardSource_, and Blockly.clipboardTypeCounts_.

These were always supposed to be private, and will disappear in the next Blockly release because of the changes in google/blockly#5237

To Fix

  • Call Blockly.getClipboardInfo to get an object containing the xml, source, and type counts.
  • Release after the next Blockly release.
@rachel-fenichel
Copy link
Collaborator Author

@BeksOmega pointed out that a better solution would be to restructure paste to not access the clipboard contents directly. It could instead call Blockly.paste or similar.

@BeksOmega
Copy link
Contributor

I think the best thing to do here is probably to modify paste in core to return the block if pasting worked (instead of true). Then we would be able to easily insert the pasted block where desired.

Sadly changing the return type of paste would be a breaking change (but I don't think many people would be affected).

Otherwise. we could create public accessors, but long-term I don't think this is a great idea. Firstly, it increases the size of Blockly's API, which is ehhhh. And secondly, it means we'll have to keep maintaining and updating keyboard nav's paste as the paste in core changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: plugin Anything in the plugins folder cleanup internal type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants