Fade the value selection field in the Attributes modal when no attribute is added (#35700)

* Fade the value selection field in the Attributes modal when no attribute is added

* Fix linter errors
This commit is contained in:
Maikel David Pérez Gómez 2022-11-24 14:32:20 -03:00 committed by GitHub
parent ee0a21e580
commit 3ff334bec9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: enhancement
Fade the value selection field in the Attributes modal when no attribute is added

View File

@ -13,6 +13,10 @@
> * { > * {
display: inline-flex; display: inline-flex;
} }
&--disabled {
opacity: 0.5;
}
} }
.woocommerce-experimental-select-control__combox-box { .woocommerce-experimental-select-control__combox-box {

View File

@ -3,6 +3,7 @@
*/ */
import { createElement, MouseEvent, useRef } from 'react'; import { createElement, MouseEvent, useRef } from 'react';
import { Icon, search } from '@wordpress/icons'; import { Icon, search } from '@wordpress/icons';
import classNames from 'classnames';
/** /**
* Internal dependencies * Internal dependencies
@ -40,7 +41,13 @@ export const ComboBox = ( {
// Keyboard users are still able to tab to and interact with elements in the combobox. // Keyboard users are still able to tab to and interact with elements in the combobox.
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */ /* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
<div <div
className="woocommerce-experimental-select-control__combo-box-wrapper" className={ classNames(
'woocommerce-experimental-select-control__combo-box-wrapper',
{
'woocommerce-experimental-select-control__combo-box-wrapper--disabled':
inputProps.disabled,
}
) }
onMouseDown={ maybeFocusInput } onMouseDown={ maybeFocusInput }
> >
{ children } { children }