Skip to content

Commit 2a7f010

Browse files
committed
Fix speaker voice dropdown overlap issue
DROPDOWN OVERLAP FIX: - Fixed z-index hierarchy to prevent voice selector dropdown from overlapping question text - Set VoiceSelector to z-[100] to ensure it appears above all other content - Set AudioControls container to z-[90] for proper layering - Added proper overflow handling to reading passage container - Ensured quiz section has lower z-index (z-10) to prevent conflicts LAYOUT IMPROVEMENTS: - Added max-height and overflow-y-auto to reading passage for better containment - Added min-h-0 to quiz section to prevent layout issues - Improved sticky positioning to prevent content overlap The voice selector dropdown now properly appears above all content without overlapping the question text or interfering with user interactions.
1 parent 845fcf2 commit 2a7f010

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

app/components/TextGenerator/AudioControls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const AudioControls = () => {
2525
if (availableVoices.length === 0) return null;
2626

2727
return (
28-
<div className="flex items-center space-x-3">
28+
<div className="flex items-center space-x-3 relative z-[90]">
2929
<PlayPauseButton
3030
isSpeakingPassage={isSpeakingPassage}
3131
isPaused={isPaused}

app/components/TextGenerator/QuizSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ const QuizSection = () => {
222222
}
223223
return (
224224
<div
225-
className="pt-6 mt-6 border-t border-gray-700 lg:border-0 lg:pt-0 lg:mt-0 space-y-4"
225+
className="pt-6 mt-6 border-t border-gray-700 lg:border-0 lg:pt-0 lg:mt-0 space-y-4 relative z-10"
226226
data-testid="quiz-section"
227227
>
228228
<div className="mb-6">

app/components/TextGenerator/TextGeneratorContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ const TextGeneratorContainer = () => {
8888
>
8989
<div className="flex flex-col lg:flex-row lg:gap-8 lg:items-start">
9090
<motion.div
91-
className="lg:w-2/5 lg:sticky lg:top-4 lg:self-start"
91+
className="lg:w-2/5 lg:sticky lg:top-4 lg:self-start lg:max-h-screen lg:overflow-y-auto"
9292
initial={{ opacity: 0, x: -20 }}
9393
animate={{ opacity: 1, x: 0 }}
9494
transition={{ duration: 0.6, delay: 0.1 }}
9595
>
9696
<ReadingPassage />
9797
</motion.div>
9898
<motion.div
99-
className="lg:w-3/5 lg:pl-4"
99+
className="lg:w-3/5 lg:pl-4 lg:min-h-0"
100100
initial={{ opacity: 0, x: 20 }}
101101
animate={{ opacity: 1, x: 0 }}
102102
transition={{ duration: 0.6, delay: 0.2 }}

app/components/TextGenerator/VoiceSelector.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ const VoiceSelector = ({
2727
);
2828
}
2929
return (
30-
<div className="relative">
30+
<div className="relative z-[100]">
3131
<select
3232
data-testid="voice-select"
3333
value={selectedVoiceURI || ''}
3434
onChange={(e) => {
3535
setSelectedVoiceURI(e.target.value);
3636
}}
37-
className="appearance-none w-full bg-gray-700 border border-gray-600 text-white py-2 pl-3 pr-8 rounded leading-tight focus:outline-none focus:bg-gray-600 focus:border-gray-500 text-sm cursor-pointer max-w-[150px] truncate"
37+
className="appearance-none w-full bg-gray-700 border border-gray-600 text-white py-2 pl-3 pr-8 rounded leading-tight focus:outline-none focus:bg-gray-600 focus:border-gray-500 text-sm cursor-pointer max-w-[150px] truncate relative z-[100]"
3838
title={t('common.selectVoice')}
3939
>
4040
{availableVoices.map((voice) => (
@@ -43,7 +43,7 @@ const VoiceSelector = ({
4343
</option>
4444
))}
4545
</select>
46-
<div className="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-400">
46+
<div className="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-400 z-[100]">
4747
<ChevronDownIcon className="w-4 h-4" />
4848
</div>
4949
</div>

0 commit comments

Comments
 (0)