feat: align public Root aliases and rework progress-bar custom-value demo
- 包根补齐固定上游 82 对 Xxx/XxxRoot 同对象别名(55 个缺失 Root 别名 + Dropdown 反向别名)与 59 个 RootProps/Menu/Dropdown 类型别名;不杜撰上游没有的名称(如 CheckboxGroupRoot、ToastRootProps) - tests/package 新增 api-root-aliases 契约:完整别名清单、82 对身份等价断言与 strict NodeNext/bundler 类型正反例 - progress-bar custom-value 演示回填公共 NumberField/Select,保持固定源文案/布局/范围/四格式与边界处理 - 修复 NumberFieldInput keydown 无条件 restore 还原同任务键入字符的缺陷,并入 number-field 回归 - 文档导航 dropdown 归位固定 meta.json 顺序并补顺序断言;修正“原生临时控件”陈述
This commit is contained in:
@@ -191,6 +191,28 @@ describe("NumberField public contracts", () => {
|
||||
expect((input.element as HTMLInputElement).value).toBe("4");
|
||||
}
|
||||
});
|
||||
it("keeps characters typed after keydown instead of restoring committed text", async () => {
|
||||
const update = vi.fn();
|
||||
const w = fixture(
|
||||
`<NumberField :model-value="4" @update:model-value="update">${parts}</NumberField>`,
|
||||
() => ({ update }),
|
||||
);
|
||||
const input = w.get('input[role="spinbutton"]');
|
||||
for (const [key, text] of [
|
||||
["9", "49"],
|
||||
["0", "490"],
|
||||
] as const) {
|
||||
await input.trigger("keydown", { key });
|
||||
await input.setValue(text);
|
||||
await input.trigger("input");
|
||||
await nextTick();
|
||||
await nextTick();
|
||||
expect((input.element as HTMLInputElement).value).toBe(text);
|
||||
}
|
||||
await input.trigger("blur");
|
||||
await flushPromises();
|
||||
expect(update).toHaveBeenCalledWith(490);
|
||||
});
|
||||
it("blocks readonly Home End wheel click and typing", async () => {
|
||||
const update = vi.fn();
|
||||
const w = fixture(
|
||||
|
||||
Reference in New Issue
Block a user