ionic-team / ionic-team/ionic-framework
bug: @ionic/react can not trigger "event.stopPropagation()"
- 主要语言
- TypeScript
- 星标
- 52.7k
- 派生
- 13.3k
- 平均合并
- 1 天 15 小时
- 30 天内合并 PR
- 51
描述
### Prerequisites
- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.
### Ionic Framework Version
v8.x
### Current Behavior
```
import {IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonCheckbox} from '@ionic/react';
import './Home.css';
import {useRef, useEffect} from 'react'
const Home: React.FC = () => {
const ref = useRef(null)
useEffect(() => {
ref.current?.addEventListener("click", (e) => {
e.stopPropagation();
});
}, [])
return (
Blank
Blank
123123
StopPropagation
);
};
export default Home;
```
click on SPAN ,trigger CheckBox selected
### Expected Behavior
click on SPAN ,not trigger CheckBox change event
### Steps to Reproduce
1. ionic start test
2. create react project
### Code Reproduction URL
https://codesandbox.io/p/github/AlwaysLoveme/test/main?import=true
### Ionic Info
Ionic:
Ionic CLI : 7.2.0 (/Users/anonymous/.nvm/versions/node/v22.11.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 8.4.1
Utility:
cordova-res : not installed globally
native-run : not installed globally
System:
NodeJS : v22.11.0 (/Users/anonymous/.nvm/versions/node/v22.11.0/bin/node)
npm : 10.9.0
OS : macOS Unknown
Environment:
http_proxy : http://127.0.0.1:7890
https_proxy : http://127.0.0.1:7890
### Additional Information
_No response_
贡献指南
调研方向
Start with the CodeSandbox reproduction and the IonCheckbox containing the span listener, then trace how click events are handled in @ionic/react. Confirm the current checkbox selection behavior and identify the relevant component entry point. Done means clicking the span no longer triggers the checkbox change event while normal checkbox clicks still work.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- react, typescript
- 领域
- frontend
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100