Skip to content
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

useHandle prop on SortableHOC example to prevent dragging on multiVal… #4387

Merged
merged 5 commits into from
Feb 5, 2021

Conversation

ebonow
Copy link
Collaborator

@ebonow ebonow commented Jan 20, 2021

Update example for Sortable HOC

Issue reported: Sortable MultiSelect: Items are incorrectly deleted on touch device #4356

Description: When using the provided example, there are two distinct behaviors when dragging a MultiValue by the MultiValueRemove component.

  1. On desktop, the clear event is overridden and the user can drag and sort the value
  2. On mobile, the clear event is called once the object has been dropped/sorted

Solution: These proposed changes updates the example so that it utilizes the useHandle prop on the SortableHOC to allow a handle to be wrapped around the MultiValueLabel

This should provide a more consistent experience of clearing the value instead of allowing it to operate as a draggable handle.

Working demo provided here: codesandbox

@changeset-bot
Copy link

changeset-bot bot commented Jan 20, 2021

🦋 Changeset detected

Latest commit: 7b7920b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@react-select/docs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ebonow ebonow linked an issue Jan 20, 2021 that may be closed by this pull request
@ebonow ebonow added this to the 3.3 milestone Jan 20, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 20, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7b7920b:

Sandbox Source
react-codesandboxer-example Configuration
react-select-sortable-handle-HOC PR

@ebonow ebonow added the category/documentation Issues or PRs about documentation or the website itself label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/documentation Issues or PRs about documentation or the website itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sortable MultiSelect: Items are incorrectly deleted on touch device
2 participants