Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TagInput] 在ononBlur事件中获取的inputvalu永远为空? #3324

Open
chenkang-noob opened this issue Jan 10, 2025 · 1 comment
Open

Comments

@chenkang-noob
Copy link

tdesign-react 版本

1.10.4

重现链接

https://knwmhswzrun-2lcb--5173--a792378e.local-credentialless.webcontainer.io

重现步骤

import React, { useState } from 'react';
import { TagInput, Space } from 'tdesign-react';
import type { TagInputProps, TagInputValue } from 'tdesign-react';

export default function TagInputBaseExample() {
const [tags1, setTags1] = useState([
'Vue',
'React',
'Angular',
]);
const [tags2] = useState(['Vue', 'React']);
const [tags3] = useState(['Vue', 'React']);

const onTagInputEnter: TagInputProps['onEnter'] = (val, context) => {
console.log(val, context);
};

const onChange: TagInputProps['onChange'] = (val, context) => {
console.log(val, context);
setTags1(val);
};

const onPaste: TagInputProps['onPaste'] = (context) => {
console.log(context);
};
const onBlur = (value, context: { inputValue: string; e: FocusEvent }) => {
console.log('onBlur =====>', value, 'ctx:', context);
};

return (

);
}

在输入后点击组件外其他地方,获取的context.inputvalue永远为""

期望结果

能获取输入的值?

实际结果

没获取输入的值

框架版本

No response

浏览器版本

No response

系统版本

No response

Node版本

No response

补充说明

No response

Copy link
Contributor

👋 @chenkang-noob,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant