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

选择器Select ,onDeselect触发时机错误 #949

Closed
Bearbearcat opened this issue Nov 21, 2024 · 0 comments
Closed

选择器Select ,onDeselect触发时机错误 #949

Bearbearcat opened this issue Nov 21, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Bearbearcat
Copy link

重现链接或代码

import { useState } from 'react'
import ReactDOM from 'react-dom'
import { Select } from '@kdcloudjs/kdesign'

const options = [
    {
      value: 'gold'
    },
    {
      value: 'lime'
    },
    {
      value: 'green'
    },
    {
      value: 'cyan'
    }
  ]

function Demo() {

  const onDeselect = () => {
    alert('onDeselect')
  }

  return (
    <div style={{ width: '350px' }}>
    <Select mode='multiple' options={options } onDeselect={onDeselect} />
    </div>
  )
}

ReactDOM.render(<Demo />, mountNode)

重现问题步骤

将此代码贴到任一组件的演示代码中,点击 Option A, 会触发onDeselect,取消选中Options A, 反而不会触发onDeselect

期望的结果是什么

点击 Option A, 不会触发onDeselect,取消选中Options A, 会触发onDeselect

实际的结果是什么

与上述相反

组件库版本号、浏览器信息

组件库与浏览器均为最新版本

@albyben albyben added this to the v1.8.21 milestone Nov 25, 2024
@albyben albyben added the bug Something isn't working label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants