Allow default values outside of the options

Created on 7 August 2025, 6 days ago

Problem/Motivation

Currently if there is a list of options (eg years) and you type in a value outside of those options, and the form reloads, the field is blank because it does not match one of the values from the options array.

This stems from an assumption in preRenderDatalist that the value is part of the options list.

Steps to reproduce

Create a datelist element with values in a certain range in a simple form that reloads on submit.
Set a default value that is outside the range (this would simulate the render after form submit with a set value)
Note that the field is blank.

Proposed resolution

Add a parameter 'allow_default_outside_range' to the render element that allows it to bypass that logic, giving the user agency over the value within the field parameters, still allowing the options to be provided as a 'suggested list of options'.

Remaining tasks

Create Fork
Add changes
Create Merge Request
Test
Review

User interface changes

The change would allow a default field outside of the dropdown values to be present in the field on load.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom ChrisDarke London

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024