🐛 Bug Report: Using conditional option in scaffolder template might cause stale data #27872
Open
Description
📜 Description
I'm re-reporting issue from #12948 which was fixed but then reverted in #27317 as it still occurs with latest version of Backstage.
Shortly: Selecting conditional option doesn't properly reset values depending on another condition.
Minimal reproducible example:
parameters:
- title: Fill in some steps
properties:
condition:
type: string
enum:
- A
- B
ui:widget: radio
ui:options:
inline: true
dependencies:
condition:
allOf:
- if:
properties:
condition:
const: A
then:
properties:
extraOption:
title: Extra option for A
type: string
👍 Expected behavior
Value of conditional field extraOption
which depends on A
should reset after selecting option B
.
👎 Actual Behavior with Screenshots
Value of extraOption
doesn't reset after option B
is selected.
Screen.Recording.2024-11-27.at.13.40.57.mov
👟 Reproduction steps
- Open Template Editor and paste in example from description.
- Select
A
as condition - Fill in any value to
extraOption
- Select
B
as condition - Proceed to Review
- Value for
extraOption
is preserved even thoughB
is selected as condition
📃 Provide the context for the Bug.
No response
🖥️ Your Environment
No response
👀 Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
No, but I'm happy to collaborate on a PR with someone else