Skip to content

Commit

Permalink
added isBusy prop to select control
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Oct 21, 2024
1 parent ad03d99 commit d84f68f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/advanced-select-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ResetButton } from '../base-control2/reset-button'
/**
* WordPress dependencies
*/
import { SelectControl } from '@wordpress/components'
import { SelectControl, Spinner } from '@wordpress/components'
import { memo } from '@wordpress/element'

/**
Expand All @@ -30,12 +30,14 @@ const AdvancedSelectControl = memo( props => {
{ ...controlProps }
className={ classnames( 'ugb-advanced-select-control', props.className ) }
>
<SelectControl
{ props.isBusy && <Spinner /> }
{ ! props.isBusy && <SelectControl
{ ...selectProps }
role="listbox"
value={ typeof props.value === 'undefined' ? value : props.value }
onChange={ typeof props.onChange === 'undefined' ? onChange : props.onChange }
/>
}
<ResetButton
allowReset={ props.allowReset }
value={ typeof props.value === 'undefined' ? value : props.value }
Expand All @@ -59,6 +61,8 @@ AdvancedSelectControl.defaultProps = {

value: undefined,
onChange: undefined,

isBusy: false,
}

export default AdvancedSelectControl

0 comments on commit d84f68f

Please sign in to comment.