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

[Switch] label多于两个字的时,切换多了几次会展示不正常 #3123

Closed
suedar opened this issue Sep 30, 2024 · 6 comments
Closed
Labels
need more info 需要更多信息理解 issue 的问题

Comments

@suedar
Copy link

suedar commented Sep 30, 2024

tdesign-react 版本

1.7.8

重现链接

No response

重现步骤

No response

期望结果

No response

实际结果

代码如下

  const renderContent = () => {
    if (value) {
      return (
        <DateRangePicker
          format="yyyy-MM-dd HH:mm:ss"
        />
      );
    }

    return <Select options={TimeRangeOptions}></Select>;
  };

  return (
    <div className="time-range-picker">
      <Switch
        size="large"
        label={['范围选择框', '时间选择框']}
        onChange={(v) => {
          setValue(v);
        }}
      />
      {renderContent()}
    </div>
  );
2024-09-30.10.18.23.mov

(请忽略后半部分的toast)

请参考视频,点多几次会展示不正常

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

Copy link
Contributor

👋 @suedar,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

@uyarn
Copy link
Collaborator

uyarn commented Oct 15, 2024

这个录屏好像没看出来展示不正常呀

@uyarn uyarn added the need more info 需要更多信息理解 issue 的问题 label Oct 15, 2024
@suedar
Copy link
Author

suedar commented Oct 15, 2024

这个录屏好像没看出来展示不正常呀

正常未选中应该显示时间选择框的,现在只显示了选择

@uyarn
Copy link
Collaborator

uyarn commented Oct 15, 2024

  const renderContent = () => {
    if (value) {
      return (
        <DateRangePicker
          format="yyyy-MM-dd HH:mm:ss"
        />
      );
    }

    return <Select options={TimeRangeOptions}></Select>;
  };

  return (
    <div className="time-range-picker">
      <Switch
        size="large"
        label={['范围选择框', '时间选择框']}
        onChange={(v) => {
          setValue(v);
        }}
      />
      {renderContent()}
    </div>
  );

懂了 但是我们这边没有复现 https://stackblitz.com/edit/react-lrhfhc-gjmicz?file=src%2Fdemo.tsx 能否在这里复现这个现象 看起来切换是正常的 或者

@uyarn
Copy link
Collaborator

uyarn commented Oct 15, 2024

Oct-15-2024.16-30-37.mp4

@suedar
Copy link
Author

suedar commented Oct 16, 2024

无法复现了 先close了 以后发现再说~

@suedar suedar closed this as completed Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need more info 需要更多信息理解 issue 的问题
Projects
None yet
Development

No branches or pull requests

2 participants