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

Line numbers are copied on rx.code_block #4648

Closed
clemlesne opened this issue Jan 16, 2025 · 2 comments
Closed

Line numbers are copied on rx.code_block #4648

clemlesne opened this issue Jan 16, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@clemlesne
Copy link

Describe the bug

Line numbers are copied when selecting the code in a Code Block (rx.code_block) component.

To Reproduce

Steps to reproduce the behavior:

  • Enable show_line_numbers on a rx.code_block
  • Try to copy the code

Expected behavior

Line numbers are only there for easy in the view, not for the clipboard.

Specifics (please complete the following information):

  • Reflex Version: 0.6.7
  • OS: macOS
  • Browser (Optional): Safari
Copy link

linear bot commented Jan 16, 2025

@Lendemor Lendemor added the bug Something isn't working label Jan 16, 2025
@Lendemor
Copy link
Collaborator

I can't reproduce the issue with the following code :

code = """A
B
C
D"""

@rx.page()
def index():
    return rx.code_block(
        code,
        show_line_numbers=True,
       can_copy=True
    )

Whether I copy manually by selecting text or by using the button, in both case the line are not included.

Do you have the specific code snippet where the error happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants