limit to 255 for short answers
This commit is contained in:
parent
9a0bd8e7f9
commit
c9cb0c719c
@ -89,6 +89,8 @@
|
|||||||
let rightOffset = 0;
|
let rightOffset = 0;
|
||||||
|
|
||||||
$: {
|
$: {
|
||||||
|
console.log(end)
|
||||||
|
|
||||||
if (prevWidth !== width) {
|
if (prevWidth !== width) {
|
||||||
leftOffset = (width - (sliderDiameter / 2)) * ((start - min) / (max - min));
|
leftOffset = (width - (sliderDiameter / 2)) * ((start - min) / (max - min));
|
||||||
rightOffset = (width - (sliderDiameter / 2)) * ((end - min) / (max - min));
|
rightOffset = (width - (sliderDiameter / 2)) * ((end - min) / (max - min));
|
||||||
|
@ -30,14 +30,18 @@
|
|||||||
placeholder="Placeholder text for the field, just like this text" />
|
placeholder="Placeholder text for the field, just like this text" />
|
||||||
<div class="col-2 properties-group">
|
<div class="col-2 properties-group">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<Dropdown col2={true} label="Style" bind:value={data.style}>
|
<Dropdown col2={true} label="Style" bind:value={data.style} on:change={updateStyle}>
|
||||||
<option value=1 selected>Short</option>
|
<option value=1 selected>Short</option>
|
||||||
<option value=2>Multi-line</option>
|
<option value=2>Multi-line</option>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" style="gap: 10px">
|
<div class="row" style="gap: 10px">
|
||||||
<Checkbox label="Required" bind:value={data.required}/>
|
<Checkbox label="Required" bind:value={data.required}/>
|
||||||
<DoubleRangeSlider label="Answer Length Range" bind:start={data.min_length} bind:end={data.max_length} min={0} max={1024} />
|
{#if data.style == 1}
|
||||||
|
<DoubleRangeSlider label="Answer Length Range" bind:start={data.min_length} bind:end={data.max_length} min={0} max={255} />
|
||||||
|
{:else}
|
||||||
|
<DoubleRangeSlider label="Answer Length Range" bind:start={data.min_length} bind:end={data.max_length} min={0} max={1024} />
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -117,6 +121,14 @@
|
|||||||
function forwardMove(direction) {
|
function forwardMove(direction) {
|
||||||
dispatch('move', {direction: direction});
|
dispatch('move', {direction: direction});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateStyle(e) {
|
||||||
|
if (e.target.value == 1) { // Short
|
||||||
|
if (data.max_length > 255) {
|
||||||
|
data.max_length = 255
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user