Skip to content

Commit

Permalink
fix: dropdowns behind questions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed Jun 13, 2024
1 parent ae1e55a commit c96bc00
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
1 change: 0 additions & 1 deletion components/content-blocks/Questions/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const QuestionList = styled.ol`
background-color: var(--list-background-color, transparent);
color: var(--question-color);
isolation: isolate;
list-style-type: decimal;
list-style-position: inside;
padding: var(--list-padding, 0);
Expand Down
5 changes: 2 additions & 3 deletions components/questions/Calculator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import useAnswer from "@/hooks/useAnswer";
import { isNullish } from "@/lib/utils";
import { WidgetInput } from "@/types/answers";
import InteractiveCalculator from "@/components/calculators/Interactive";
import QuestionNumber from "../QuestionNumber";
import * as Styled from "./styles";
import { Equation } from "@/types/calculators";

Expand All @@ -32,7 +31,7 @@ const CalculatorQuestion: FunctionComponent<CalculatorQuestionProps> = ({
if (isNullish(equation)) return null;

return (
<QuestionNumber {...{ id }}>
<Styled.QuestionNumber {...{ id }}>
<label htmlFor={id}>{questionText}</label>
<Styled.CalculatorWrapper>
<InteractiveCalculator
Expand All @@ -44,7 +43,7 @@ const CalculatorQuestion: FunctionComponent<CalculatorQuestionProps> = ({
}}
/>
</Styled.CalculatorWrapper>
</QuestionNumber>
</Styled.QuestionNumber>
);
};

Expand Down
5 changes: 5 additions & 0 deletions components/questions/Calculator/styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";
import styled from "styled-components";
import { token } from "@rubin-epo/epo-react-lib/styles";
import BaseQuestionNumber from "../QuestionNumber";

export const CalculatorWrapper = styled.div`
display: flex;
Expand All @@ -16,3 +17,7 @@ export const CalculatorWrapper = styled.div`
font-size: 150%;
}
`;

export const QuestionNumber = styled(BaseQuestionNumber)`
container-type: inline-size;
`;
2 changes: 1 addition & 1 deletion components/questions/QuestionNumber/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const QuestionNumber: FunctionComponent<
value={questionIndex + 1}
data-direction={direction}
className={className}
style={{ zIndex: maxIndex - questionIndex }}
style={{ "--z-index-dropdown-open": maxIndex - questionIndex }}
>
{children}
</Styled.Number>
Expand Down
3 changes: 0 additions & 3 deletions components/questions/QuestionNumber/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import styled from "styled-components";

export const Number = styled.li`
container-type: inline-size;
position: relative;
&[data-direction="block"] {
& > * + * {
margin-block-start: var(--PADDING_SMALL, 20px);
Expand Down

0 comments on commit c96bc00

Please sign in to comment.