Skip to content

Log viewer inside tabs issue #1869

Closed
@marcin-koziol

Description

Description

I want to place the Log component in the tab, everything is OK, but to see the logs, you first need to switch to the Log viewer tab

from datetime import datetime
from nicegui import ui


with ui.row():
    with ui.tabs().classes('w-full').props(add="dense align=left") as tabs:
        one = ui.tab('Something')
        logs = ui.tab('Logs')
    ui.separator()

    with ui.tab_panels(tabs, value=one).classes('w-full').style('min-height: 268px'):
        with ui.tab_panel(one):
            ui.image('https://picsum.photos/id/377/640/360').style('max-width: 420px')
        with ui.tab_panel(logs):
            log = ui.log(max_lines=10).classes('w-full h-20')


with ui.row():
    ui.button('Log time', on_click=lambda: log.push(datetime.now().strftime('%X.%f')[:-5]))

ui.run()

In this example:

  • run
  • click on "Log time" button
  • switch to the "Logs" tab - no entries here
  • click again
  • enties are visible

Metadata

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions