Misleading clear buttons in language/timezone settings cause API errors #16073

Closed
opened 2026-02-21 19:24:32 -05:00 by yindo · 1 comment
Owner

Originally created by @lyzno1 on GitHub (Aug 12, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy
  • This is only for bug report
  • I have searched for existing issues
  • I confirm that I am using English to submit this report
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template and fill in all the required fields

Dify version

Latest main branch

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Open account settings (click profile avatar)
  2. Navigate to Language settings page
  3. Click the X button on either "Interface Language" or "Timezone" selector
  4. Observe error toast message: "is not a valid language"
  5. Refresh page - the setting remains unchanged

✔️ Expected Behavior

  • X buttons should not appear on required settings like language and timezone
  • OR X buttons should work properly without causing errors
  • OR there should be validation preventing empty values from being sent to API

Actual Behavior

  • X buttons are displayed suggesting users can clear required settings
  • Clicking X triggers API call with empty values
  • Backend validation fails with "is not a valid language" error
  • Setting remains unchanged after refresh
  • Poor user experience with misleading UI elements
Originally created by @lyzno1 on GitHub (Aug 12, 2025). ## Self Checks - [x] I have read the Contributing Guide and Language Policy - [x] This is only for bug report - [x] I have searched for existing issues - [x] I confirm that I am using English to submit this report - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template and fill in all the required fields ## Dify version Latest main branch ## Cloud or Self Hosted Self Hosted (Source) ## Steps to reproduce 1. Open account settings (click profile avatar) 2. Navigate to Language settings page 3. Click the X button on either "Interface Language" or "Timezone" selector 4. Observe error toast message: "is not a valid language" 5. Refresh page - the setting remains unchanged ## ✔️ Expected Behavior - X buttons should not appear on required settings like language and timezone - OR X buttons should work properly without causing errors - OR there should be validation preventing empty values from being sent to API ## ❌ Actual Behavior - X buttons are displayed suggesting users can clear required settings - Clicking X triggers API call with empty values - Backend validation fails with "is not a valid language" error - Setting remains unchanged after refresh - Poor user experience with misleading UI elements
yindo added the 🐞 bug label 2026-02-21 19:24:32 -05:00
yindo closed this issue 2026-02-21 19:24:32 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 12, 2025):

This is a confirmed bug: the clear (X) buttons on the language and timezone selectors allow users to clear required fields, which sends empty values to the backend and triggers validation errors like "is not a valid language" or "is not a valid timezone" (frontend code, backend code). This matches similar issues reported by other users (#13405, #23077).

The SimpleSelect component always shows the clear button unless the notClearable prop is set, but this prop isn't used for these required fields (SimpleSelect code). The backend strictly requires non-empty values and will always reject empty submissions.

To fix this, the clear button should be disabled for required fields by setting the notClearable prop on the selectors for language and timezone. Alternatively, the frontend could block empty values from being submitted, or the backend could provide a more user-friendly error message. Disabling the clear button is the most direct solution and aligns with expected UX for required settings.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Aug 12, 2025): <!-- Answer --> This is a confirmed bug: the clear (X) buttons on the language and timezone selectors allow users to clear required fields, which sends empty values to the backend and triggers validation errors like "is not a valid language" or "is not a valid timezone" ([frontend code](https://github.com/langgenius/dify/blob/1ffe1905578ee6d87184c71440e8786cc638f63d/web/app/components/header/account-setting/language-page/index.tsx), [backend code](https://github.com/langgenius/dify/blob/1ffe1905578ee6d87184c71440e8786cc638f63d/api/controllers/console/workspace/account.py)). This matches similar issues reported by other users ([#13405](https://github.com/langgenius/dify/issues/13405), [#23077](https://github.com/langgenius/dify/issues/23077)). The SimpleSelect component always shows the clear button unless the `notClearable` prop is set, but this prop isn't used for these required fields ([SimpleSelect code](https://github.com/langgenius/dify/blob/1ffe1905578ee6d87184c71440e8786cc638f63d/web/app/components/base/select/index.tsx)). The backend strictly requires non-empty values and will always reject empty submissions. To fix this, the clear button should be disabled for required fields by setting the `notClearable` prop on the selectors for language and timezone. Alternatively, the frontend could block empty values from being submitted, or the backend could provide a more user-friendly error message. Disabling the clear button is the most direct solution and aligns with expected UX for required settings. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/fad51ef2-e20e-4b19-b27a-4621572e0d3f?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/fad51ef2-e20e-4b19-b27a-4621572e0d3f?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/fad51ef2-e20e-4b19-b27a-4621572e0d3f?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/fad51ef2-e20e-4b19-b27a-4621572e0d3f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fad51ef2-e20e-4b19-b27a-4621572e0d3f?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/fad51ef2-e20e-4b19-b27a-4621572e0d3f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fad51ef2-e20e-4b19-b27a-4621572e0d3f?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/23790)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#16073