Skip to content

Using decimal step sizes in range #137

@PGimenez

Description

@PGimenez

It seems it is not possible to have decimal range step size. Here's a MWE with what I've tried:

using GenieFramework
@genietools

@app begin
  @in range= RangeData(UnitRange(0.0,1.0))
  @in qrange= StippleUI.Ranges.QRange(0.0,0.1,1.0)
  @onchange range begin
    @show range
  end
  @onchange qrange begin
    @show qrange
  end
end
ui() = range(0:0.1:1.0,:range)*range(0:0.1:1.0,:qrange)

@page("/", ui)

This is the HTML that's generated:

<q-range :min=0.0 v-model="range" :max=1.0 :step=0.1>
</q-range><q-range :min=0.0 v-model="qrange" :max=1.0 :step=0.1></q-range>

The RangeDatatype does not directly accept floats, so you have to pass a UnitRangeto it. However, the range does not work the browser and the console shows an error:

CleanShot 2024-12-11 at 10 49 24

On the other hand the q-range bound to the QRange object does nothing, the handler is not triggered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions