Skip to content

web/forms: fix forms not resetting state when modal closes#19562

Merged
GirlBossRush merged 3 commits intomainfrom
sdko/fix-model-form-reset
Jan 21, 2026
Merged

web/forms: fix forms not resetting state when modal closes#19562
GirlBossRush merged 3 commits intomainfrom
sdko/fix-model-form-reset

Conversation

@dominic-r
Copy link
Member

@dominic-r dominic-r commented Jan 19, 2026

Overview:

Forms were not properly resetting their state when closing modals, which caused stale values to persist when reopening forms. This affected all forms with @state() decorated properties.

Testing:

  1. Create any item (user, token, application, etc.), close modal
  2. Click Create again, form should show default/empty values
  3. Edit an item, cancel, click Create - form should be empty
  4. Edit an item, cancel, edit same item - should show correct data

Motivation:

Form inputs retained values from previous create/edit operations.

@dominic-r dominic-r added this to the Release 2025.12.2 milestone Jan 19, 2026
@dominic-r dominic-r self-assigned this Jan 19, 2026
@dominic-r dominic-r requested a review from a team as a code owner January 19, 2026 03:37
@dominic-r dominic-r added area:frontend Features or issues related to the browser, TypeScript, Node.js, etc backport/version-2025.12 Add this label to PRs to backport changes to version-2025.12 labels Jan 19, 2026
@netlify
Copy link

netlify bot commented Jan 19, 2026

Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit aa72037
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/69703f16b6fd740008b0864d
😎 Deploy Preview https://deploy-preview-19562--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Jan 19, 2026

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit cbfaae3
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/69703d468a66d800087750bc
😎 Deploy Preview https://deploy-preview-19562--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.28%. Comparing base (ecaa673) to head (aa72037).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19562      +/-   ##
==========================================
+ Coverage   93.25%   93.28%   +0.02%     
==========================================
  Files         949      949              
  Lines       52131    52131              
==========================================
+ Hits        48617    48629      +12     
+ Misses       3514     3502      -12     
Flag Coverage Δ
conformance 38.26% <ø> (+<0.01%) ⬆️
e2e 44.11% <ø> (+<0.01%) ⬆️
integration 23.21% <ø> (+<0.01%) ⬆️
unit 91.52% <ø> (+<0.01%) ⬆️
unit-migrate 91.55% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2026

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-aa7203726d50199ceb54f5f3e099918ef09131b1
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-aa7203726d50199ceb54f5f3e099918ef09131b1

Afterwards, run the upgrade commands from the latest release notes.

@GirlBossRush GirlBossRush self-requested a review January 19, 2026 16:01
@GirlBossRush GirlBossRush force-pushed the sdko/fix-model-form-reset branch from 52405e2 to ef936b5 Compare January 20, 2026 17:29
dominic-r and others added 2 commits January 21, 2026 03:43
Overview:

Forms were not properly resetting their state when closing modals, which caused stale values to persist when reopening forms. This affected all forms with @State() decorated properties.

Testing:

1. Create any item (user, token, application, etc.), close modal
2. Click Create again, form should show default/empty values
3. Edit an item, cancel, click Create - form should be empty
4. Edit an item, cancel, edit same item - should show correct data

Motivation:

Form inputs retained values from previous create/edit operations.
@GirlBossRush GirlBossRush force-pushed the sdko/fix-model-form-reset branch from ef936b5 to cbfaae3 Compare January 21, 2026 02:43
@GirlBossRush GirlBossRush force-pushed the sdko/fix-model-form-reset branch from cbfaae3 to aa72037 Compare January 21, 2026 02:51
@GirlBossRush
Copy link
Contributor

@dominic-r This is a great improvement over the current behavior. #19395, and its follow up in #18916 solves this by completely clearing the modal from the page, but that'll take some time to merge.

This PR touches a lot of places so I've pushed up a few type changes which allow these changes to merge into #19395:

  • Added protected and public where appropriate
  • Added Lit Analyzer doc strings
  • Enabled additional analyzer checks
  • More consistent usage of null over undefined for stateful properties

@dominic-r
Copy link
Member Author

Thanks for these great updates @GirlBossRush !

@github-project-automation github-project-automation bot moved this from Todo to In Progress in authentik Core Jan 21, 2026
@GirlBossRush GirlBossRush merged commit 66d6d88 into main Jan 21, 2026
142 of 144 checks passed
@GirlBossRush GirlBossRush deleted the sdko/fix-model-form-reset branch January 21, 2026 06:15
@github-project-automation github-project-automation bot moved this from In Progress to Done in authentik Core Jan 21, 2026
authentik-automation bot pushed a commit that referenced this pull request Jan 21, 2026
This cherry-pick has conflicts that need manual resolution.

Original PR: #19562
Original commit: 66d6d88
@authentik-automation
Copy link
Contributor

⚠️ Cherry-pick to version-2025.12 has conflicts: #19635

GirlBossRush pushed a commit that referenced this pull request Jan 21, 2026
This cherry-pick has conflicts that need manual resolution.

Original PR: #19562
Original commit: 66d6d88
GirlBossRush pushed a commit that referenced this pull request Jan 21, 2026
This cherry-pick has conflicts that need manual resolution.

Original PR: #19562
Original commit: 66d6d88
GirlBossRush pushed a commit that referenced this pull request Jan 21, 2026
This cherry-pick has conflicts that need manual resolution.

Original PR: #19562
Original commit: 66d6d88
GirlBossRush pushed a commit that referenced this pull request Jan 21, 2026
This cherry-pick has conflicts that need manual resolution.

Original PR: #19562
Original commit: 66d6d88
kensternberg-authentik added a commit that referenced this pull request Jan 21, 2026
…experiment

* main:
  sources/saml: properly catch InvalidSignature exception (#19641)
  sources/saml: Set AuthnRequest ProtocolBinding to HTTP-POST instead of HTTP-Redirect (#17378)
  website/docs: update endpoint agent windows log location (#19645)
  core: bump library/node from 25.3.0-trixie to 25.4.0-trixie in /website (#19632)
  core, web: update translations (#19535)
  core: bump github.com/pires/go-proxyproto from 0.8.1 to 0.9.0 (#19628)
  core: bump django-stubs[compatible-mypy] from 5.2.8 to 5.2.9 (#19629)
  web: bump @types/react from 19.2.8 to 19.2.9 in /web in the react group across 1 directory (#19631)
  core: bump sentry-sdk from 2.49.0 to 2.50.0 (#19630)
  website/integrations: update qnap (#19644)
  website/docs: Update saml google workspace guide (#19624)
  web/elements: reduce spacing between collapsible form groups (#19627)
  web/forms: fix forms not resetting state when modal closes (#19562)
  web/user: fix Firefox for Android infinite render loop in user library (#19379)
GirlBossRush added a commit that referenced this pull request Jan 22, 2026
* web/forms: fix forms not resetting state when modal closes

Overview:

Forms were not properly resetting their state when closing modals, which caused stale values to persist when reopening forms. This affected all forms with @State() decorated properties.

Testing:

1. Create any item (user, token, application, etc.), close modal
2. Click Create again, form should show default/empty values
3. Edit an item, cancel, click Create - form should be empty
4. Edit an item, cancel, edit same item - should show correct data

Motivation:

Form inputs retained values from previous create/edit operations.

* Fix linter errors, types.

* Add property accessors, types.

---------

Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
dominic-r added a commit that referenced this pull request Jan 22, 2026
#19562 to version-2025.12) (#19635)

web/forms: fix forms not resetting state when modal closes (#19562)

* web/forms: fix forms not resetting state when modal closes

Overview:

Forms were not properly resetting their state when closing modals, which caused stale values to persist when reopening forms. This affected all forms with @State() decorated properties.

Testing:

1. Create any item (user, token, application, etc.), close modal
2. Click Create again, form should show default/empty values
3. Edit an item, cancel, click Create - form should be empty
4. Edit an item, cancel, edit same item - should show correct data

Motivation:

Form inputs retained values from previous create/edit operations.

* Fix linter errors, types.

* Add property accessors, types.

---------

Co-authored-by: Dominic R <dominic@sdko.org>
Co-authored-by: Teffen Ellis <592134+GirlBossRush@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Features or issues related to the browser, TypeScript, Node.js, etc backport/version-2025.12 Add this label to PRs to backport changes to version-2025.12

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants