# elasticpress/5.3.5/assets/js/sync-ui/components/limits.js

ElasticPress, version 5.3.5. 79 lines.

- Page: https://pluginprobe.com/plugins/elasticpress/5.3.5/code/assets/js/sync-ui/components/limits.js
- Raw: https://pluginprobe.com/plugins/elasticpress/5.3.5/raw/assets/js/sync-ui/components/limits.js
- Modified: 2025-04-10T13:16:00+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elasticpress/5.3.5/code/assets/js/sync-ui/components/limits.js#L10-L20`.

```javascript
/**
 * WordPress dependencies.
 */
import { Flex, FlexItem, TextControl } from '@wordpress/components';
import { WPElement } from '@wordpress/element';
import { __ } from '@wordpress/i18n';

/**
 * Internal dependencies.
 */
import { useSync } from '../../sync';
import { useSyncSettings } from '../provider';

/**
 * Delete checkbox component.
 *
 * @returns {WPElement} Sync page component.
 */
export default () => {
	const { isSyncing } = useSync();
	const { args, setArgs } = useSyncSettings();

	/**
	 * Handle changing the lower limit.
	 *
	 * @param {string} value Selected lower ID.
	 * @returns {void}
	 */
	const onChangeLower = (value) => {
		const lower_limit_object_id = value ? Math.max(0, value) : value;

		setArgs({ ...args, lower_limit_object_id });
	};

	/**
	 * Handle changing the upper limit.
	 *
	 * @param {string} value Selected upper ID.
	 * @returns {void}
	 */
	const onChangeUpper = (value) => {
		const upper_limit_object_id = value ? Math.max(0, value) : value;

		setArgs({ ...args, upper_limit_object_id });
	};

	return (
		<Flex className="ep-sync-advanced-control" justify="start">
			<FlexItem grow="2">
				<TextControl
					disabled={isSyncing}
					help={__('Sync objects with an ID of this number or higher.', 'elasticpress')}
					label={__('Lower object ID', 'elasticpress')}
					max={args.upper_limit_object_id}
					min="0"
					onChange={onChangeLower}
					type="number"
					value={args.lower_limit_object_id}
					__nextHasNoMarginBottom
					__next40pxDefaultSize
				/>
			</FlexItem>
			<FlexItem grow="2">
				<TextControl
					disabled={isSyncing}
					help={__('Sync objects with an ID of this number or lower.', 'elasticpress')}
					label={__('Higher object ID', 'elasticpress')}
					min={args.lower_limit_object_id}
					onChange={onChangeUpper}
					type="number"
					value={args.upper_limit_object_id}
					__nextHasNoMarginBottom
					__next40pxDefaultSize
				/>
			</FlexItem>
		</Flex>
	);
};

```
