|
7 | 7 | PopoverBody, |
8 | 8 | PopoverContent, |
9 | 9 | PopoverTrigger, |
10 | | - Portal, |
11 | 10 | Tag, |
12 | 11 | TagLabel, |
13 | 12 | Text, |
@@ -316,64 +315,63 @@ const EditableSubscriptionsCell: React.FC<EditableSubscriptionsCellProps> = ({ |
316 | 315 | </Box> |
317 | 316 | </PopoverTrigger> |
318 | 317 |
|
319 | | - <Portal> |
320 | | - <PopoverContent |
321 | | - width={ |
322 | | - triggerRef.current?.offsetWidth |
323 | | - ? `${triggerRef.current.offsetWidth}px` |
324 | | - : '100%' |
325 | | - } |
326 | | - borderColor="neutralGray.300" |
327 | | - ref={popoverRef} |
328 | | - zIndex={1} |
329 | | - mt="2px" |
330 | | - > |
331 | | - <PopoverBody p={0} maxHeight="300px" overflowY="auto" zIndex={1}> |
332 | | - {sortedSubjects.map((subject) => { |
333 | | - const isSelected = selectedSubjectIds.includes(subject.id); |
334 | | - const bgColor = subject.colorGroup.colorCodes[1]; |
335 | | - const borderColor = subject.colorGroup.colorCodes[1]; |
336 | | - |
337 | | - return ( |
338 | | - <Box |
339 | | - key={subject.id} |
340 | | - p={2.5} |
341 | | - pl={4} |
342 | | - display="flex" |
343 | | - alignItems="center" |
344 | | - _hover={{ bg: 'neutralGray.100' }} |
345 | | - onClick={(e) => handleSubjectChange(subject.id, e)} |
346 | | - cursor="pointer" |
347 | | - > |
348 | | - <Checkbox |
349 | | - isChecked={isSelected} |
350 | | - onChange={(e) => { |
351 | | - e.nativeEvent.stopPropagation(); |
352 | | - handleSubjectChange(subject.id); |
353 | | - }} |
354 | | - mr={2} |
355 | | - _checked={{ |
356 | | - '& .chakra-checkbox__control': { |
357 | | - bg: bgColor, |
358 | | - borderColor: borderColor, |
359 | | - }, |
360 | | - }} |
361 | | - _hover={{ |
362 | | - '& .chakra-checkbox__control': { |
363 | | - borderColor: borderColor, |
364 | | - bg: bgColor, |
365 | | - opacity: 0.7, |
366 | | - }, |
367 | | - }} |
368 | | - borderColor={borderColor} |
369 | | - /> |
370 | | - <Text textStyle="label">{subject.name}</Text> |
371 | | - </Box> |
372 | | - ); |
373 | | - })} |
374 | | - </PopoverBody> |
375 | | - </PopoverContent> |
376 | | - </Portal> |
| 318 | + <PopoverContent |
| 319 | + width={ |
| 320 | + triggerRef.current?.offsetWidth |
| 321 | + ? `${triggerRef.current.offsetWidth}px` |
| 322 | + : '100%' |
| 323 | + } |
| 324 | + maxWidth="80vw" |
| 325 | + borderColor="neutralGray.300" |
| 326 | + ref={popoverRef} |
| 327 | + zIndex={1} |
| 328 | + mt="2px" |
| 329 | + > |
| 330 | + <PopoverBody p={0} maxHeight="300px" overflowY="auto" zIndex={1}> |
| 331 | + {sortedSubjects.map((subject) => { |
| 332 | + const isSelected = selectedSubjectIds.includes(subject.id); |
| 333 | + const bgColor = subject.colorGroup.colorCodes[1]; |
| 334 | + const borderColor = subject.colorGroup.colorCodes[1]; |
| 335 | + |
| 336 | + return ( |
| 337 | + <Box |
| 338 | + key={subject.id} |
| 339 | + p={2.5} |
| 340 | + pl={4} |
| 341 | + display="flex" |
| 342 | + alignItems="center" |
| 343 | + _hover={{ bg: 'neutralGray.100' }} |
| 344 | + onClick={(e) => handleSubjectChange(subject.id, e)} |
| 345 | + cursor="pointer" |
| 346 | + > |
| 347 | + <Checkbox |
| 348 | + isChecked={isSelected} |
| 349 | + onChange={(e) => { |
| 350 | + e.nativeEvent.stopPropagation(); |
| 351 | + handleSubjectChange(subject.id); |
| 352 | + }} |
| 353 | + mr={2} |
| 354 | + _checked={{ |
| 355 | + '& .chakra-checkbox__control': { |
| 356 | + bg: bgColor, |
| 357 | + borderColor: borderColor, |
| 358 | + }, |
| 359 | + }} |
| 360 | + _hover={{ |
| 361 | + '& .chakra-checkbox__control': { |
| 362 | + borderColor: borderColor, |
| 363 | + bg: bgColor, |
| 364 | + opacity: 0.7, |
| 365 | + }, |
| 366 | + }} |
| 367 | + borderColor={borderColor} |
| 368 | + /> |
| 369 | + <Text textStyle="label">{subject.name}</Text> |
| 370 | + </Box> |
| 371 | + ); |
| 372 | + })} |
| 373 | + </PopoverBody> |
| 374 | + </PopoverContent> |
377 | 375 | </Popover> |
378 | 376 | </Box> |
379 | 377 | ); |
|
0 commit comments