Skip to content

Strange behavior of input placed on tab #34

@ustas4

Description

@ustas4
from datastack import datastack
from varname.helpers import exec_code

ds = datastack(main=True)
count = 0
delta = 1
ds.subheader("DataStack click counter app " + str(count), id="id_count")

tab1, tab2 = ds.tabs(["tab1", "tab2"])
tab1.subheader("this is subheader", id="id")


#
# 
# def inc_count():
#     global count
#     global delta
#     count += delta
#
#
# tab1.button("Click", on_click=inc_count)
# tab1.subheader("counts: " + str(count), id="id_count2")
# code = "tab1.button('dynamic text', on_click=inc_count)"
# exec_code(code)
#
#


# # input
def new_input(a1: any, xi_new_value):
    global delta
    delta = xi_new_value


tab1.subheader('Input value', id="id_input")
input_value: int = 0
input_value = tab1.input('Input:', str(input_value), id="id_input_value", on_change=new_input, args=(0, input_value))
tab1.write("counts: " + str(input_value))

value on input element does not changed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions