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

Update script.js #21

Closed
wants to merge 1 commit into from
Closed

Update script.js #21

wants to merge 1 commit into from

Conversation

kishore280
Copy link

Clipboard function test

This pull request fixes an issue where the "Copy to Clipboard" buttons for the Python and JSON code snippets were not copying the correct content.

The original code incorrectly passed the ID of the button itself (#clipboard and #clipboardJSON) to the clipboard function, instead of the ID of the element containing the code to be copied (#python and #json).

This PR corrects this by updating the event listeners to pass the correct selectors to the clipboard function, ensuring that the intended code snippets are copied to the clipboard when the buttons are clicked.

Changes:

Updated the clipboard function calls in the event listeners for #clipboard and #clipboardJSON to use the correct selectors (#python and #json, respectively).
Testing:

Tested the functionality by clicking the "Copy to Clipboard" buttons for both Python and JSON code snippets and verifying that the correct code was copied to the clipboard.
This fix improves the user experience by ensuring that the clipboard functionality works as expected, allowing users to easily copy the generated code snippets.

Clipboard function test
@kishore280 kishore280 marked this pull request as draft October 3, 2024 15:07
@kishore280 kishore280 marked this pull request as ready for review October 3, 2024 15:07
@kishore280 kishore280 closed this Oct 3, 2024
@kishore280 kishore280 reopened this Oct 3, 2024
@kishore280 kishore280 closed this Oct 3, 2024
@kishore280 kishore280 reopened this Oct 3, 2024
@capjamesg
Copy link
Collaborator

This issue has been fixed in #14 and merged.

@capjamesg capjamesg closed this Oct 4, 2024
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.

2 participants