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

Copy button scrolls with content #203

Open
minhperry opened this issue Oct 21, 2024 · 0 comments
Open

Copy button scrolls with content #203

minhperry opened this issue Oct 21, 2024 · 0 comments

Comments

@minhperry
Copy link

minhperry commented Oct 21, 2024

View on load:

image

On scroll:

image

This doesn't apply for content with no scroll, well, because there are no scroll so the position is fixed.

I have tried to overwrite with this CSS, then the button will not scroll with content.

.copy-button, .copy-success {
    position: sticky;
    margin-left: auto;
}

.code-container {
    display: flex; // or inline-flex works too.
}

However the .copy-success will just simply disappear if the container is scrollable. It is still in DOM, just that the svg is somehow not rendered (size is 8 x 24 in that case)

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

1 participant