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

persistent values with Mutiple CopyButton #7

Open
chrisblodgett opened this issue Feb 1, 2025 · 0 comments
Open

persistent values with Mutiple CopyButton #7

chrisblodgett opened this issue Feb 1, 2025 · 0 comments

Comments

@chrisblodgett
Copy link

Hello There,

This is a very cool module, just a quick question. I have 3 CopyButtons and I assign each of them their values in my panel app dynamically when a certain data is changed. Everything is fine until I try to click a button again that I've already clicked on the clipboard doesn't change. For example, if I copy the copy_access_key button, then copy_secret_key_button and then back to copy_access_key_button the clipboard doesn't change. I think once I paste from a button the value is cleared maybe? Is there a way to keep the values from clearing out so that they always copy? Sorry if this isn't an issue but just me being dumb :)

thanks,
Chris

copy_access_key_button = CopyButton(name='Copy Access Key')
copy_secret_key_button = CopyButton(name='Copy Secret Key')
copy_path_button = CopyButton(name='Copy Path')

setting values-

            copy_access_key_button.value = buckets[0].access_key
            copy_secret_key_button.value = buckets[0].secret_access_key
            copy_path_button.value = f"{s3_config['incoming_bucket_name']}/incoming/{selected_user_text.value}/{selected_job_text.value}/"
            path: str = f"{s3_config['incoming_bucket_name']}/<BR>incoming/<BR>{selected_user_text.value}/<BR>{selected_job_text.value}/"
            job_bucket_access_key.value = buckets[0].access_key
            job_bucket_secret_key.value = buckets[0].secret_access_key
            job_bucket_path.value = path
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