Repository: arco-design/arco-design (ts)

Issue:
Popconfirm中使用Switch，无法弹出确认框 
- [ ] I'm sure this does not appear in [the issue list of the repository](https://github.com/arco-design/arco-design/issues)

## Basic Info 
- **Package Name And Version:** @arco-design/web-react@2.32.0
- **Browser:** chrome100.0.4896.127
- **Reproduction Link:** https://codesandbox.io/s/sad-ganguly-dt863e?file=/src/App.js:0-689

## What is expected?
Popconfirm中使用Switch，正确弹出确认框 


<!-- generated by arco-issue. DO NOT REMOVE -->

Pull request:
fix: switch onclick
<!--
  Thanks so much for your PR and contribution.

  Before submitting, please make sure to follow the Pull Request Guidelines: https://github.com/arco-design/arco-design/blob/main/CONTRIBUTING.md
-->

<!-- Put an `x` in "[ ]" to check a box) -->

## Types of changes

<!-- What types of changes does this PR introduce -->
<!-- Only support choose one type, if there are multiple types, you can add the `Type` column in the Changelog. -->

- [ ] New feature
- [x] Bug fix
- [ ] Enhancement
- [ ] Documentation change
- [ ] Coding style change
- [ ] Component style change
- [ ] Refactoring
- [ ] Test cases
- [ ] Continuous integration
- [ ] Typescript definition change
- [ ] Breaking change
- [ ] Others 

## Background and context

<!-- Explain what problem does the PR solve -->
<!-- Link to related open issues if applicable -->

## Solution

<!-- Describe how the problem is fixed in detail -->

## How is the change tested?

<!-- Unit tests should be added/updated for bug fixes and new features, if applicable -->
<!-- Please describe how you tested the change. E.g. Creating/updating unit tests or attaching a screenshot of how it works with your change -->

## Changelog

| Component | Changelog(CN) | Changelog(EN) | Related issues |
| --------- | ------------- | ------------- | -------------- |
|     Switch      |    修复 `Switch` 组件无法触发 `Popconfirm` 弹出层显示的 bug。           |    Fixed a bug where the `Switch` component could not trigger the display of the `Popconfirm` popup layer.           |    Close #828             |

<!-- If there are multiple types, you can add the `Type` column in the Changelog, the value of the column is the same as `Types of changes` -->
## Checklist:

- [ ] Test suite passes (`npm run test`)
- [ ] Provide changelog for relevant changes (e.g. bug fixes and new features) if applicable.
- [ ] Changes are submitted to the appropriate branch (e.g. features should be submitted to `feature` branch and others should be submitted to `main` branch)

## Other information

<!-- Please describe what other information that should be taken care of. E.g. describe the impact if introduce a breaking change -->


Patch:
diff --git a/components/Switch/index.tsx b/components/Switch/index.tsx
index 9af48e0a..45feaca7 100644
--- a/components/Switch/index.tsx
+++ b/components/Switch/index.tsx
@@ -46,6 +46,7 @@ function Switch(baseProps: SwitchProps, ref) {
     if (loading) {
       return;
     }
+    props.onClick && props.onClick(event);
     if (!('checked' in props)) {
       setChecked(!mergedChecked);
     }
diff --git a/components/Switch/interface.ts b/components/Switch/interface.ts
index 0e4e07ad..58b72ffe 100644
--- a/components/Switch/interface.ts
+++ b/components/Switch/interface.ts
@@ -1,9 +1,10 @@
-import { CSSProperties, ReactNode } from 'react';
+import { CSSProperties, ReactNode, HTMLAttributes } from 'react';
 
 /**
  * @title Switch
  */
-export interface SwitchProps {
+export interface SwitchProps
+  extends Omit<HTMLAttributes<HTMLButtonElement>, 'className' | 'onChange'> {
   style?: CSSProperties;
   className?: string | string[];
   /**
diff --git a/components/Tree/node-list.tsx b/components/Tree/node-list.tsx
index 9bb4ac2d..0cb47ecd 100644
--- a/components/Tree/node-list.tsx
+++ b/components/Tree/node-list.tsx
@@ -36,7 +36,7 @@ function NodeList(props, ref) {
     const currentExpandKeysSet = new Set(currentExpandKeys);
     nodeList.forEach((nodeProps) => {
       const pathParentKeys = nodeProps.pathParentKeys || [];
-      // 如果父节点处于正在展开状态，子节点暂时不可见，因为父节点的children会在animaiton中渲染出来。
+      // 如果父节点处于正在展开状态，子节点暂时不可见，因为父节点的children会在animation中渲染出来。
       // 当动画完成时，父节点children隐藏，此时在这里渲染子节点。 anyway，一切为了动画！！！
       if (
         pathParentKeys.every((key) => !currentExpandKeysSet.has(key) && expandedKeysSet.has(key))
diff --git a/components/Typography/utils.tsx b/components/Typography/utils.tsx
index 0cdac5a3..d12886b8 100644
--- a/components/Typography/utils.tsx
+++ b/components/Typography/utils.tsx
@@ -46,6 +46,7 @@ export function measure(
     document.body.appendChild(mirrorElement);
   }
   const originStyle = window.getComputedStyle(originElement);
+  const originWhiteSpace = originStyle.whiteSpace || 'normal';
   const extraStyle: ExtraStyle = {
     height: 'auto',
     'min-height': 'auto',
@@ -56,6 +57,8 @@ export function measure(
     position: 'fixed',
     'z-index': '-200',
     'text-overflow': 'clip',
+    // The folding threshold cannot be calculated in the nowrap scene
+    'white-space': originWhiteSpace === 'nowrap' ? 'normal' : originWhiteSpace,
     overflow: 'auto',
   };
   if (!isNumber(originStyle.width)) {


Test patch:
diff --git a/components/Switch/__test__/index.test.tsx b/components/Switch/__test__/index.test.tsx
index c8a2090a..1e9c485c 100644
--- a/components/Switch/__test__/index.test.tsx
+++ b/components/Switch/__test__/index.test.tsx
@@ -4,6 +4,7 @@ import { act } from 'react-dom/test-utils';
 import mountTest from '../../../tests/mountTest';
 import componentConfigTest from '../../../tests/componentConfigTest';
 import Switch from '..';
+import Popconfirm from '../../Popconfirm';
 import IconCheck from '../../../icon/react-icon/IconCheck';
 import IconClose from '../../../icon/react-icon/IconClose';
 
@@ -71,4 +72,20 @@ describe('Switch', () => {
 
     component.find('.arco-switch-dot .arco-switch-dot-icon svg').hasClass('arco-icon-check');
   });
+
+  it('showTriger ', () => {
+    const component = mount(
+      <Popconfirm title="xxx">
+        <Switch />
+      </Popconfirm>
+    );
+
+    act(() => {
+      component.simulate('click');
+    });
+
+    component.update();
+
+    expect(component.find('.arco-popconfirm')).toHaveLength(1);
+  });
 });