Fix double overlay on selects in modals
Selects now take an optional property `overlayVisible` that if false, doesn't render visual elements of its overlay.
This commit is contained in:
parent
6bc887c95b
commit
ff3b6af7af
8 changed files with 20 additions and 4 deletions
|
|
@ -410,6 +410,7 @@ const AXSelect = (props: Props) => {
|
||||||
onOpenChange={() => openSelect(1)}
|
onOpenChange={() => openSelect(1)}
|
||||||
onValueChange={handleAX1SelectChange}
|
onValueChange={handleAX1SelectChange}
|
||||||
triggerClass="modal"
|
triggerClass="modal"
|
||||||
|
overlayVisible={false}
|
||||||
>
|
>
|
||||||
{generateOptions(0)}
|
{generateOptions(0)}
|
||||||
</Select>
|
</Select>
|
||||||
|
|
@ -439,6 +440,7 @@ const AXSelect = (props: Props) => {
|
||||||
onValueChange={handleAX2SelectChange}
|
onValueChange={handleAX2SelectChange}
|
||||||
triggerClass="modal"
|
triggerClass="modal"
|
||||||
ref={secondaryAxModifierSelect}
|
ref={secondaryAxModifierSelect}
|
||||||
|
overlayVisible={false}
|
||||||
>
|
>
|
||||||
{generateOptions(1)}
|
{generateOptions(1)}
|
||||||
</Select>
|
</Select>
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ const ExtendedMasterySelect = ({
|
||||||
onOpenChange={() => changeOpen('left')}
|
onOpenChange={() => changeOpen('left')}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
triggerClass="Left modal"
|
triggerClass="Left modal"
|
||||||
|
overlayVisible={false}
|
||||||
>
|
>
|
||||||
{generateLeftOptions()}
|
{generateLeftOptions()}
|
||||||
</Select>
|
</Select>
|
||||||
|
|
@ -146,6 +147,7 @@ const ExtendedMasterySelect = ({
|
||||||
onValueChange={handleRightSelectChange}
|
onValueChange={handleRightSelectChange}
|
||||||
onOpenChange={() => changeOpen('right')}
|
onOpenChange={() => changeOpen('right')}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
|
overlayVisible={false}
|
||||||
triggerClass={classNames({
|
triggerClass={classNames({
|
||||||
Right: true,
|
Right: true,
|
||||||
modal: true,
|
modal: true,
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ const JobSkillSearchFilterBar = (props: Props) => {
|
||||||
value={-1}
|
value={-1}
|
||||||
triggerClass="Bound"
|
triggerClass="Bound"
|
||||||
open={open}
|
open={open}
|
||||||
|
overlayVisible={false}
|
||||||
onValueChange={onChange}
|
onValueChange={onChange}
|
||||||
onOpenChange={openSelect}
|
onOpenChange={openSelect}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,6 @@
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
backdrop-filter: blur(5px) saturate(100%) brightness(80%) opacity(0);
|
|
||||||
animation: 0.24s ease-in fadeInFilter;
|
|
||||||
animation-fill-mode: forwards;
|
|
||||||
|
|
||||||
&.Job {
|
&.Job {
|
||||||
animation: none;
|
animation: none;
|
||||||
|
|
@ -16,6 +13,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&.Visible {
|
&.Visible {
|
||||||
|
animation: 0.24s ease-in fadeInFilter;
|
||||||
|
animation-fill-mode: forwards;
|
||||||
|
backdrop-filter: blur(5px) saturate(100%) brightness(80%) opacity(0);
|
||||||
background: rgba(0, 0, 0, 0.6);
|
background: rgba(0, 0, 0, 0.6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ interface Props
|
||||||
onValueChange?: (value: string) => void
|
onValueChange?: (value: string) => void
|
||||||
onClose?: () => void
|
onClose?: () => void
|
||||||
triggerClass?: string
|
triggerClass?: string
|
||||||
|
overlayVisible?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
const Select = React.forwardRef<HTMLButtonElement, Props>(function Select(
|
const Select = React.forwardRef<HTMLButtonElement, Props>(function Select(
|
||||||
|
|
@ -94,7 +95,10 @@ const Select = React.forwardRef<HTMLButtonElement, Props>(function Select(
|
||||||
|
|
||||||
<RadixSelect.Portal className="Select">
|
<RadixSelect.Portal className="Select">
|
||||||
<>
|
<>
|
||||||
<Overlay open={open} visible={false} />
|
<Overlay
|
||||||
|
open={open}
|
||||||
|
visible={props.overlayVisible != null ? props.overlayVisible : true}
|
||||||
|
/>
|
||||||
|
|
||||||
<RadixSelect.Content
|
<RadixSelect.Content
|
||||||
className="Select"
|
className="Select"
|
||||||
|
|
@ -116,4 +120,8 @@ const Select = React.forwardRef<HTMLButtonElement, Props>(function Select(
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Select.defaultProps = {
|
||||||
|
overlayVisible: true,
|
||||||
|
}
|
||||||
|
|
||||||
export default Select
|
export default Select
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ const SelectTableField = (props: Props) => {
|
||||||
onClose={props.onClose}
|
onClose={props.onClose}
|
||||||
triggerClass={classNames({ Bound: true, Table: true })}
|
triggerClass={classNames({ Bound: true, Table: true })}
|
||||||
value={value}
|
value={value}
|
||||||
|
overlayVisible={false}
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
</Select>
|
</Select>
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,7 @@ const SelectWithInput = ({
|
||||||
onOpenChange={changeOpen}
|
onOpenChange={changeOpen}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
triggerClass="modal"
|
triggerClass="modal"
|
||||||
|
overlayVisible={false}
|
||||||
>
|
>
|
||||||
{generateOptions()}
|
{generateOptions()}
|
||||||
</Select>
|
</Select>
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,7 @@ const WeaponKeySelect = React.forwardRef<HTMLButtonElement, Props>(
|
||||||
onValueChange={handleChange}
|
onValueChange={handleChange}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
triggerClass="modal"
|
triggerClass="modal"
|
||||||
|
overlayVisible={false}
|
||||||
>
|
>
|
||||||
<SelectItem key="no-key" value="no-key">
|
<SelectItem key="no-key" value="no-key">
|
||||||
{emptyOption()}
|
{emptyOption()}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue