updates to a Input's disabled property causes the value property to reset
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
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start by reproducing the behavior in the linked Solid playground, comparing the four input cases when you edit their values and toggle disabled. Then trace how Solid updates input properties in its DOM rendering code and find the relevant tests. Done means toggling disabled does not reset an edited value when value is reactive, with the other cases still behaving as expected.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
When both the disabled and value property of an input are signals, changes to the disabled property causes the value to reset to its initial value even after being modified.
Is this expected behavior?
Below is both code and a playground link. Just change the values in the four boxes and then click "CLICK ME".
https://playground.solidjs.com/MattLysinger/6fabf761-9664-462b-a96e-2e5f82c3b3f3
import { render } from "@solidjs/web";
import { createSignal } from "solid-js";
function Counter() {
let ref1!: HTMLInputElement;
let ref2!: HTMLInputElement;
const [disabled, setDisabled] = createSignal(false);
const [value, setValue] = createSignal(11);
return (
<>
<button
type="button"
onClick={() => {
setDisabled((x) => !x);
ref1.disabled = !ref1.disabled;
ref2.disabled = !ref2.disabled;
}}
>
CLICK ME
</button>
<p>1. disabled & value are both signals and the disabled signal is toggled</p>
<input disabled={disabled()} type="number" value={value()} />
<p>2. disabled is a signal and value is a number and the disabled signal is toggled</p>
<input disabled={disabled()} type="number" value={11} />
<p>3. value is a signal and the disabled property is directly toggled</p>
<input ref={ref1} type="number" value={value()} />
<p>4. value is a number and the disabled signal is directly toggled</p>
<input ref={ref2} type="number" value={11} />
</>
);
}
render(() => <Counter />, document.getElementById("app")!);
Originally posted by @MattLysinger in https://github.com/solidjs/solid/discussions/4496
- Ngôn ngữ chính
- TypeScript
- Star
- 36.2k
- Fork
- 1.1k
- Merge trung bình
- 9 giờ
- Pull request đã merge (30 ngày)
- 463
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 solidjs/solid
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 54/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`<style>` and `<script>` children inside MathML are not escaped in SSR (and static DOM templates), allowing markup injectionCó thể đã có người làm @santhiprakash đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày 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ó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
solidjs/solid#4689 · 1 bình luận ·
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 55/100
solidjs/solid#4685 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
1.x
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Yeraze/meshmonitor#6239 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
better-auth/better-auth#12292 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The sample email preview's ResizeObserver is never disconnected and keeps raising errors after leaving SettingsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ui bug effort:S priority:P2
Độ 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
-
Typo in WSL project description on Projects pageCó thể đã có người làm @akhil9tiet đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
microsoft/opensource.microsoft.com#1066 · 1 bình luận ·