Merge pull request #190 from jedmund/fix-double-overlay
Fix double overlay on Selects
This commit is contained in:
commit
f04e3a8ffe
12 changed files with 27 additions and 6 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>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
box-shadow: 0 1px 4px rgb(0 0 0 / 8%);
|
box-shadow: 0 1px 4px rgb(0 0 0 / 8%);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
min-width: 15vw;
|
min-width: 30vw;
|
||||||
margin: 0 $unit-2x;
|
margin: 0 $unit-2x;
|
||||||
// top: $unit-8x; // This shouldn't be hardcoded. How to calculate it?
|
// top: $unit-8x; // This shouldn't be hardcoded. How to calculate it?
|
||||||
// Also, add space that doesn't make the menu disappear if you move your mouse slowly
|
// Also, add space that doesn't make the menu disappear if you move your mouse slowly
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,7 @@ const Header = () => {
|
||||||
const urlCopyToast = () => {
|
const urlCopyToast = () => {
|
||||||
return (
|
return (
|
||||||
<Toast
|
<Toast
|
||||||
|
altText={t('toasts.copied')}
|
||||||
open={copyToastOpen}
|
open={copyToastOpen}
|
||||||
duration={2400}
|
duration={2400}
|
||||||
type="foreground"
|
type="foreground"
|
||||||
|
|
@ -242,6 +243,7 @@ const Header = () => {
|
||||||
const remixToast = () => {
|
const remixToast = () => {
|
||||||
return (
|
return (
|
||||||
<Toast
|
<Toast
|
||||||
|
altText={t('toasts.remixed', { title: originalName })}
|
||||||
open={remixToastOpen}
|
open={remixToastOpen}
|
||||||
duration={2400}
|
duration={2400}
|
||||||
type="foreground"
|
type="foreground"
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import * as ToastPrimitive from '@radix-ui/react-toast'
|
||||||
import './index.scss'
|
import './index.scss'
|
||||||
|
|
||||||
interface Props extends ToastPrimitive.ToastProps {
|
interface Props extends ToastPrimitive.ToastProps {
|
||||||
|
altText: string
|
||||||
className?: string
|
className?: string
|
||||||
title?: string
|
title?: string
|
||||||
content: React.ReactNode
|
content: React.ReactNode
|
||||||
|
|
@ -12,6 +13,7 @@ interface Props extends ToastPrimitive.ToastProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const Toast = ({
|
const Toast = ({
|
||||||
|
altText,
|
||||||
children,
|
children,
|
||||||
title,
|
title,
|
||||||
content,
|
content,
|
||||||
|
|
@ -39,7 +41,7 @@ const Toast = ({
|
||||||
<p>{content}</p>
|
<p>{content}</p>
|
||||||
</ToastPrimitive.Description>
|
</ToastPrimitive.Description>
|
||||||
{children && (
|
{children && (
|
||||||
<ToastPrimitive.Action asChild altText="">
|
<ToastPrimitive.Action asChild altText={altText}>
|
||||||
{children}
|
{children}
|
||||||
</ToastPrimitive.Action>
|
</ToastPrimitive.Action>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ const UpdateToast = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Toast
|
<Toast
|
||||||
|
altText={t(`toasts.description.${updateType}`)}
|
||||||
className={classes}
|
className={classes}
|
||||||
title={t(`toasts.title`)}
|
title={t(`toasts.title`)}
|
||||||
content={t(`toasts.description.${updateType}`)}
|
content={t(`toasts.description.${updateType}`)}
|
||||||
|
|
|
||||||
|
|
@ -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