Skip to content

[Bug] Data validation shows "invalid" on cells with valid dropdown values #6597

@taweijm

Description

@taweijm

Bug Description

When using data validation with a list/dropdown type, cells that contain valid pre-filled values (matching the dropdown options) incorrectly show an "Invalid" notification. Empty cells with allowBlank: true do NOT show the error — only cells with valid values do.

Minimal Reproduction

https://gist.github.com/taweijm/bf5089eec89814a3f77677b37be6d87f

Save the HTML file and open it directly in a browser (no build step needed). Look at Column A.

Steps to Reproduce

  1. Open the reproduction HTML file in Chrome
  2. Column A has dropdown validation with options: ["Draft", "Submitted", "Approved"], allowBlank: true
  3. Cells A2, A3, A4 are pre-filled with "Draft", "Submitted", "Approved" (all valid options)
  4. Hover over cells A2, A3, A4 — they show "Invalid" notification
  5. Cells A5 and A6 are empty — they correctly do NOT show "Invalid"

Expected Behavior

Cells with values that match the dropdown list options should be treated as valid and should NOT show an "Invalid" notification.

Actual Behavior

Cells with valid pre-filled values show "Invalid" notification. Only empty cells are treated as valid.

Environment

  • Univer version: 0.15.5
  • Browser: Chrome (latest)
  • OS: Windows 11

This is a resubmission of #6592 which was closed for lacking minimal reproduction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions