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

Initial Value of Tabs is Ignored #477

Closed
mtanco opened this issue Jan 9, 2021 · 2 comments
Closed

Initial Value of Tabs is Ignored #477

mtanco opened this issue Jan 9, 2021 · 2 comments
Assignees
Labels
bug Bug in code ui Related to UI

Comments

@mtanco
Copy link
Contributor

mtanco commented Jan 9, 2021

Wave SDK Version, OS

Server and SDK 0.10.0
OS X

Actual behavior

Initial, selected value of ui.tabs and ui.tab_card is always the first option.

Expected behavior

The selected option should be value if provided.

Steps To Reproduce

from h2o_wave import main, app, Q, ui

@app('/')
async def serve(q: Q):
    q.page['tabs'] = ui.tab_card(
        box='1 1 11 1',
        items=[ui.tab(name=f'#{t}', label=t.upper()) for t in 'abc'],
        value='c'  # This is ignored and the 'a' will be selected
    )
    q.page['form_tabs'] = ui.form_card(
        box='1 2 11 1',
        items=[ui.tabs(
            name='my_tabs', 
            items=[ui.tab(name=f'#{t}', label=t.upper()) for t in 'abc'],
            value='c'  # This is ignored and the 'a' will be selected
        )],
    )
    await q.page.save()

image

Related, I think, to #349

@mtanco mtanco added ui Related to UI bug Bug in code labels Jan 9, 2021
@mturoci mturoci self-assigned this Jan 11, 2021
@mturoci
Copy link
Collaborator

mturoci commented Jan 11, 2021

Hi @mtanco, the specified value has to be same as tab name property. I assume you want to change hash on click as well, so please change:

value='c'  # This is ignored and the 'a' will be selected

to

value='#c'  # Prepend '#'

@mtanco
Copy link
Contributor Author

mtanco commented Jan 11, 2021

OHHH yes thank you.

@mtanco mtanco closed this as completed Jan 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in code ui Related to UI
Projects
None yet
Development

No branches or pull requests

2 participants