Hi,
I would like to build a stepper widget that set item.state only when a button is pressed.
My current code is :
uid: stepper_with_validate
tags: [ ]
props:
parameters:
- context: item
description: An item to control
label: Item
name: item
required: true
type: TEXT
- default: "0"
label: Minimum
name: min
required: false
type: INTEGER
- default: "100"
label: Maximum
name: max
required: false
type: INTEGER
- default: "1"
label: Step
name: step
required: false
type: INTEGER
variables:
localStepperValue: Number(items[props.item]?.state)
timestamp: Jul 27, 2025, 4:08:09 PM
component: f7-card
config: {}
slots:
default:
- component: f7-block
config:
style:
display: flex
flex-direction: column
align-items: center
gap: 10px
slots:
default:
- component: oh-stepper
config:
min: =props.min
max: =props.max
step: =props.step
variable: localStepperValue
fill: true
raised: true
round: true
- component: oh-button
config:
text: = (vars.localStepperValue != items[props.item]?.state)?`Update from ${items[props.item]?.state} to ${vars.localStepperValue}`:"Up to date"
style:
width: 100%
action: command
actionItem: =props.item
actionCommand: =vars.localStepperValue
almost everything works fine but localStepperValue is undefined until a change stepper value.
How to solve that ?
Thanks