Skip to content

fix: "dropdown-cell" cell cannot be pasted correctly #1018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

uioonm
Copy link

@uioonm uioonm commented Jan 21, 2025

fix issue #1017

@lukasmasuch lukasmasuch requested a review from Copilot March 7, 2025 10:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR fixes an issue (#1017) where the "dropdown-cell" could not correctly paste values. It updates the pasting logic to better handle different data structures within the allowedValues array.

  • Update the onPaste condition to support values that are either primitives or objects with a value property.
  • Adjust the logic to ensure a proper match is made before overriding the cell value.

Reviewed Changes

File Description
packages/cells/src/cells/dropdown-cell.tsx Improves paste logic by checking for both primitive and object forms in allowedValues

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

packages/cells/src/cells/dropdown-cell.tsx:226

  • [nitpick] Consider renaming the arrow function parameter 'i' to 'item' for improved clarity and readability.
value: d.allowedValues.some((i) => i === v || i.value === v) ? v : d.value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant