suryaparua-official commented on PR #3274:
URL: 
https://github.com/apache/apisix-dashboard/pull/3274#issuecomment-4004665547

   Hi @DSingh0304
   
   I tested the SchemaForm demo locally from this PR branch.
   
   Steps to reproduce:
   
   1. Navigate to `/ui/schema_form_demo`
   2. Select `auth_type = oauth`
   3. Fill the OAuth fields
   4. Change `auth_type` to `api_key`
   
   Expected behavior:
   When switching to `api_key`, OAuth-related fields should be removed from the 
form state.
   
   Actual behavior:
   The OAuth fields remain in the form data even after switching to `api_key`.
   
   Example form data after switching:
   
   {
     "auth_type": "api_key",
     "oauth_client_id": "...",
     "oauth_client_secret": "..."
   }
   
   It seems the previous `oneOf` branch values remain in the react-hook-form 
state.
   
   Screenshot attached for reference.
   <img width="957" height="764" alt="Screenshot 2026-03-05 173751" 
src="https://github.com/user-attachments/assets/df7fe05f-2042-428a-b5e6-639ca6e139c1";
 />
   <img width="960" height="770" alt="Screenshot 2026-03-05 173830" 
src="https://github.com/user-attachments/assets/48c95eba-e481-499b-a9bf-e78a10300ab7";
 />
   <img width="960" height="768" alt="Screenshot 2026-03-05 173858" 
src="https://github.com/user-attachments/assets/7f632d02-7c32-4eb9-a3ba-3621a1eb5f35";
 />
   <img width="958" height="765" alt="Screenshot 2026-03-05 173935" 
src="https://github.com/user-attachments/assets/1e9cd715-c5b4-4788-a94d-9d71d65c06c3";
 />
   <img width="965" height="773" alt="Screenshot 2026-03-05 174003" 
src="https://github.com/user-attachments/assets/235ab79e-46c6-441e-a495-83195dde8c37";
 />
   <img width="959" height="769" alt="Screenshot 2026-03-05 174021" 
src="https://github.com/user-attachments/assets/85f1ed72-483c-4447-bfd2-cfa4188b2b00";
 />
   
   Let me know if you would like me to explore a potential fix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to