const ScanBarcodeOrQRCode=(props)=>{ const { barcode, setBarcode, handleClose, isMobile=false, config} = props const {Row, Col} = ReactBootstrap const [loading, setLoading] = useState(false) const handleChangeBarcodeCode=(value)=>{ if (value== null || value.trim()==''){ return } const cleanValue = value.replace(/[\n\r]+/g, ''); // 3. (Tùy chọn) Trim để loại bỏ khoảng trắng ở 2 đầu nếu còn sót lại setBarcode(cleanValue.trim()); } const handleCompleteScanQR=()=>{ handleChangeBarcodeCode(barcode) handleClose() } return (
setBarcode(e.target.value)} type='text' required={false} feedback={null} onEnter={(e)=>handleChangeBarcodeCode(e.target.value)} size="sm" autoFocus={true} // Tự động tập trung vào TextInput onFocus={(e) => e.target.select()} tabIndex={1} // Thiết lập tabIndex cho TextInput /> {isMobile && }
) }