apply radio btn selection logic to insert item also

This commit is contained in:
rikinsk 2019-08-29 15:31:40 +05:30
parent ae97c36c9d
commit 78ca9f38a7

View File

@ -9,8 +9,6 @@ import TextInput from '../../../Common/CustomInputTypes/TextInput';
import Button from '../../../Common/Button/Button';
import { getPlaceholder, BOOLEAN, JSONB, JSONDTYPE, TEXT } from '../utils';
import { getParentNodeByClass } from '../../../../utils/domFunctions';
import { NotFoundError } from '../../../Error/PageNotFound';
class InsertItem extends Component {
@ -81,12 +79,9 @@ class InsertItem extends Component {
refs[colName] = { valueNode: null, nullNode: null, defaultNode: null };
const inputRef = node => (refs[colName].valueNode = node);
const clicker = e => {
const checkboxLabel = getParentNodeByClass(e.target, 'radio-inline');
if (checkboxLabel) {
checkboxLabel.click();
} else {
e.target.parentNode.click();
}
e.target
.closest('.radio-inline')
.querySelector('input[type="radio"]').checked = true;
e.target.focus();
};