ionic-team / ionic-team/ionic-framework
bug: React IonLabel corrupts global styles
- Ngôn ngữ chính
- TypeScript
- Star
- 52.7k
- Fork
- 13.3k
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 51
Mô tả
### 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
v8.8.1 regression from v8.7.17.
IonLabel with dynamic text node child corrupts global styles.
Workaround: `{myString}`
### Expected Behavior
No change to global styles when rendering string in IonLabel
### Steps to Reproduce
1. Render IonLabel
1.1. Pass a dynamic string containing special characters (< > or similar) directly as a text node child of IonLabel
2. Observe global ion-item padding/styles reset across entire app
3. Wrap the same string in a `` — issue disappears
### Code Reproduction URL
https://stackblitz.com/edit/h92ft2xq?file=src%2Fmain.tsx
### Ionic Info
Ionic:
Ionic CLI : 7.2.0 (/usr/local/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 8.8.1
Utility:
cordova-res : not installed globally
native-run : 2.0.3
System:
NodeJS : v22.17.0 (/usr/local/bin/node)
npm : 10.9.2
OS : macOS Unknown
### Additional Information
Code Reproduction URL does not reproduce; it has no global styles that get affected.
I cannot invest more time into this report unfortunately, else I would parse to identify the exact string that causes the issue.
Just happy to advise of our workaround.
Hướng dẫn đóng góp
Hướng nghiên cứu
Start with the linked StackBlitz reproduction and compare IonLabel behavior between @ionic/react 8.8.1 and 8.7.17, noting that the current reproduction does not show the global-style failure. Identify the dynamic string that triggers the regression and verify that rendering it directly in IonLabel no longer resets global ion-item padding or styles.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 28/100