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

Fix wrapping in <button> when created in JS #6

Merged
merged 6 commits into from
Sep 18, 2016
Merged

Fix wrapping in <button> when created in JS #6

merged 6 commits into from
Sep 18, 2016

Conversation

shvaikalesh
Copy link
Contributor

@shvaikalesh shvaikalesh commented Sep 10, 2016

Creating <copy-button> in JavaScript like this:

let btn = document.createElement("copy-button")
btn.textContent = "hello, world"

will result in hello, world not being wrapped in <button>, because wrapping happens on line 1 and created <button> gets deleted on line 2.

I would say this PR is breaking (because of onclick and IE8 support) and deserves 2.0.

if (toCopy = this.getAttribute('target-text')) {
return copy(toCopy);
function handleCopyClick(event) {
if (event.defaultPrevented) return;
Copy link
Contributor Author

@shvaikalesh shvaikalesh Sep 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is breaking too. Now mimics other controls. Default behavior may be prevented on capturing.

@sudodoki
Copy link
Owner

Looks good, would happily merge! What do you think: do we need to update document-register-element from 0.3.0 to 1.1.1 or even get rid of it altogether?

@sudodoki sudodoki merged commit cd72b0f into sudodoki:master Sep 18, 2016
@sudodoki sudodoki mentioned this pull request Sep 18, 2016
3 tasks
@shvaikalesh
Copy link
Contributor Author

shvaikalesh commented Sep 18, 2016

I am pretty sure we should not specify a specific shim in dependencies.

Roadmap: transit to V1, upgrade API as I mentioned in #5, move shim from package.json to README.md

@shvaikalesh
Copy link
Contributor Author

shvaikalesh commented Sep 18, 2016

However, for 2.x, lets update it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants