-
Notifications
You must be signed in to change notification settings - Fork 11
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
Copy to Clipboard Functionality #34
Conversation
…d. Added to sidebar controls.
Hey @JGriffCS! First of all, Thanks for the PR. We cannot put it atop the sidebar becase:
I will add more comments on the issue itself so that it's more findable. |
… better editor actions. Add ability to clear editor.
Per our discussion in #10 I pulled in Let me know if you have any thoughts on colors/styles or anything else. I was also wondering where you sourced your icons from? I had originally intended to use icons for both the actions, but since the |
onClick={clearEditor} | ||
style={actionButtonStyles} | ||
> | ||
X |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use × instead of a normal X?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! Done.
@boywithsilverwings
I haven't heard back from you regarding issue #10 so I figured I'd go ahead and open a PR and we could communicate here regarding how you'd like it implemented.
I created a new component to handle the copying functionality and placed it in the sidebar. For now I've wrapped it in a FieldSet/Field combo to handle the margins/padding. Initially I tried to find a solution that didn't involve creating a new element from which to select/copy, but as far as I can tell the way the monaco editor is structured makes it impossible to perform these operators directly upon it.
For now the button itself fills the full width of the sidebar and uses the same styles as the "Load" button and "On" switches. Please let me know if you'd like changes made to the positioning, size, styles, wording, etc...
One thing I wasn't able to figure out was how to enable/disable the button based on if the editor had content. If you have any insight into how to do this, please let me know and I'll make the necessary changes. For now the button is always active which doesn't seem to cause any issues.