Skip to content

Commit f8c1a7b

Browse files
committed
refactor: remove some api
1 parent 96f7155 commit f8c1a7b

File tree

3 files changed

+0
-19
lines changed

3 files changed

+0
-19
lines changed

docs/api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ const inputRef = useRef<InputNumberRef>(null);
197197
useEffect(() => {
198198
inputRef.current.focus(); // the input will get focus
199199
inputRef.current.blur(); // the input will lose focus
200-
console.log(inputRef.current.input); // The origin input element
201200
}, []);
202201
// ....
203202
<InputNumber ref={inputRef} />;
@@ -207,4 +206,3 @@ useEffect(() => {
207206
| -------- | --------------------------------------- | --------------------------------- |
208207
| focus | `(options?: InputFocusOptions) => void` | The input get focus when called |
209208
| blur | `() => void` | The input loses focus when called |
210-
| input | `HTMLInputElement \| null` | The origin input element |

src/InputNumber.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ export type { ValueType };
2626
export interface InputNumberRef extends HTMLInputElement {
2727
focus: (options?: InputFocusOptions) => void;
2828
blur: () => void;
29-
setSelectionRange: (
30-
start: number,
31-
end: number,
32-
direction?: 'forward' | 'backward' | 'none',
33-
) => void;
34-
select: () => void;
35-
input: HTMLInputElement | null;
3629
nativeElement: HTMLElement;
3730
}
3831

tests/input.test.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,6 @@ describe('InputNumber.Input', () => {
224224
expect(onChange).not.toHaveBeenCalled();
225225
});
226226

227-
it('input should work', () => {
228-
const ref = React.createRef<InputNumberRef>();
229-
const { container } = render(<InputNumber ref={ref} />);
230-
const inputEl = container.querySelector('input')!;
231-
const rootEl = container.querySelector('.rc-input-number')!;
232-
233-
expect(ref.current?.input).toBe(inputEl);
234-
expect(ref.current?.nativeElement).toBe(rootEl);
235-
});
236-
237227
describe('nativeElement', () => {
238228
it('basic', () => {
239229
const ref = React.createRef<InputNumberRef>();

0 commit comments

Comments
 (0)