Skip to content

copying the content of ui.code after set_content yields to the initial content #5177

@jlmanaloto

Description

@jlmanaloto

First Check

  • I added a very descriptive title here.
  • This is not a Q&A. I am sure something is wrong with NiceGUI or its documentation.
  • I used the GitHub search to find a similar issue and came up empty.

Example Code

from nicegui import ui

c = ui.code('''
    from nicegui import ui

    ui.label('Code inception!')

    ui.run()
''').classes('w-full')
c.set_content('new content')
c.update()

ui.run()

Description

Copying the content of ui.code always gives the initial content even after using set_content() and update(). Given the example code, I would expect to get "new content" when pasting to a text editor but instead, I still get the code block from the initialized value of ui.code content.

NiceGUI Version

2.24.2

Python Version

Python 3.11.9

Browser

Chrome

Operating System

Windows

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    analysisStatus: Requires team/community inputbugType/scope: A problem that needs fixing🟡 mediumPriority: Relevant, but not essential

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions