app-walk
Version:
An intuitive guided walkthrough library with UI highlighting and voice narration for web apps.
13 lines (12 loc) • 606 B
TypeScript
/**
* 原生 input/textarea 等元素设置值的通用函数。
* 通过直接设置 .value 并派发 input 事件,触发 React 受控组件的 onChange 和验证。
*
* 注意:
* - 仅适用于原生表单元素,如 <input>, <textarea>, 以及支持 .value 的控件。
* - 对于 antd Select、Radio、DatePicker 等非原生组件,需使用模拟点击等方式更新值。
*
* @param element - 原生输入元素,如 HTMLInputElement、HTMLTextAreaElement
* @param value - 需要设置的新值
*/
export declare function setValueNatively(element: HTMLElement, value: string): void;