bug: Slot-Fallback hidden when newlines exists
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
Hướng nghiên cứu
Bắt đầu với tham chiếu slot-polyfill-utils.ts và bản tái hiện CodeSandbox được liên kết, sau đó so sánh hành vi được giới thiệu bởi pull request 6082. Tái hiện trường hợp khoảng trắng/xuống dòng và trường hợp inline; được coi là hoàn tất khi một default slot trống vẫn giữ fallback slot-fb hiển thị khi markup của host chỉ chứa khoảng trắng và các dòng mới.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already report this problem, without success.
Stencil Version
4.23+
Current Behavior
Hi there,
i encounter a bug with the latest version 4.25.1, but the issue comes from 4.23.1 https://github.com/ionic-team/stencil/pull/6082. And the correct addition see here the the comment https://github.com/johnjenkins/stencil/blob/2c607c6407f9ed2a256ec85973e1c6384b701d21/src/runtime/slot-polyfill-utils.ts#L10
The problem is:
<s-text-field>
<span slot="label">Label</span>
</s-text-field>
Due whitespace/newlines in the default slot is the which gets and its hidden.
Here is everything fine:
<s-text-field><span slot="label">Label</span></s-text-field>
Here we have an empty which get and its not hidden.
Expected Behavior
is visible with empty default slot with newlines and whitespaces.
System Info
Platform: windows (10.0.22621)
CPU Model: AMD Ryzen 7 7840U w/ Radeon 780M Graphics (16 cpus)
Compiler: C:\www\repos\huk\web-lib-style\node_modules\@stencil\core\compiler\stencil.js
Build: 1737767058
Stencil: 4.25.1
TypeScript: 5.5.4
Rollup: 2.56.3
Parse5: 7.1.2
jQuery: 4.0.0-pre
Terser: 5.31.1
Steps to Reproduce
The render method ot this stencil component looks like this:
@Component({
tag: 's-text-field',
})
export class STextField {
render() {
return (
<Host>
<label class={'wrapper'}>
<div class={'description'}>
<div>
<slot name="label" />
</div>
</div>
<div class={'input-wrapper'}>
<div class={'input'}>
<slot>
<input />
</slot>
</div>
</div>
</label>
</Host>);
}
}
Code Reproduction URL
https://codesandbox.io/p/devbox/slot-bug-reproduce-6hhnwj
Additional Information
The slot fallback ist needed to get a external <input into the webcomponent:
<s-text-field>
<input type="text" />
</s-text-field>
Cheers and thanks for your hard work!
- Ngôn ngữ chính
- TypeScript
- Star
- 13.2k
- Fork
- 865
- Merge trung bình
- 2 ngày 16 giờ
- Pull request đã merge (30 ngày)
- 29
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của stenciljs/core
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(mock-doc): `Element.toggleAttribute()` is missing, so components that use it fail during SSRĐang mởtriage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Stencil FOUC styles should use @layer to avoid cascade conflicts with React 19Có thể đã có người làm @johnjenkins đã nhận 230 ngày trước. Đang mởStencil v5
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
stenciljs/core#7016 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của stenciljs/core
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AykutSarac/jsoncrack.com#616 ·
-
nip27: long hashtag swallows the rest of the content, lone # gives an empty hashtagCó thể đã có người làm @bardrop đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
nbd-wtf/nostr-tools#578 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
backnotprop/plannotator#3427 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/Power-CAT-Copilot-Studio-Kit#942 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG]: Duplicate preposition in heading and unformatted feedback text on Strengthen Argument pageĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AOSSIE-Org/DebateAI#801 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày