Browse Source

no prevent label click default behavior

pull/8335/head
afc163 7 years ago
parent
commit
bf70d30a60
  1. 3
      components/form/FormItem.tsx

3
components/form/FormItem.tsx

@ -216,14 +216,13 @@ export default class FormItem extends React.Component<FormItemProps, any> {
// Resolve duplicated ids bug between different forms
// https://github.com/ant-design/ant-design/issues/7351
onLabelClick = (e) => {
onLabelClick = () => {
const id = this.props.id || this.getId();
if (!id) {
return;
}
const controls = document.querySelectorAll(`[id="${id}"]`);
if (controls.length !== 1) {
e.preventDefault();
const control = findDOMNode(this).querySelector(`[id="${id}"]`) as HTMLElement;
if (control && control.focus) {
control.focus();

Loading…
Cancel
Save