Disable Done button if no display selected
This commit is contained in:
parent
4c10e3312c
commit
faa3309a8e
|
@ -458,8 +458,9 @@ var ProductsBlockSettingsEditor = function (_React$Component3) {
|
|||
{ type: 'button', className: 'button wc-products-settings__footer-button', onClick: this.props.done_callback },
|
||||
__('Done')
|
||||
);
|
||||
if (['specific', 'category', 'attribute'].includes(this.state.display) && !this.props.selected_display_setting.length) {
|
||||
if (['', 'specific', 'category', 'attribute'].includes(this.state.display) && !this.props.selected_display_setting.length) {
|
||||
var done_tooltips = {
|
||||
'': __('Please make a selection'),
|
||||
specific: __('Please search for and select products to display'),
|
||||
category: __('Please select at least one category to display'),
|
||||
attribute: __('Please select an attribute')
|
||||
|
|
|
@ -268,8 +268,9 @@ class ProductsBlockSettingsEditor extends React.Component {
|
|||
}
|
||||
|
||||
let done_button = <button type="button" className="button wc-products-settings__footer-button" onClick={ this.props.done_callback }>{ __( 'Done' ) }</button>;
|
||||
if ( [ 'specific', 'category', 'attribute' ].includes( this.state.display ) && ! this.props.selected_display_setting.length ) {
|
||||
if ( ['', 'specific', 'category', 'attribute'].includes( this.state.display ) && ! this.props.selected_display_setting.length ) {
|
||||
const done_tooltips = {
|
||||
'': __( 'Please make a selection' ),
|
||||
specific: __( 'Please search for and select products to display' ),
|
||||
category: __( 'Please select at least one category to display' ),
|
||||
attribute: __( 'Please select an attribute' ),
|
||||
|
|
Loading…
Reference in New Issue