Skip to content

Commit

Permalink
Merge pull request #483 from weilirs/WA-button-position
Browse files Browse the repository at this point in the history
fix: prevent writing assistant's trigger from being invisible
  • Loading branch information
samlhuillier authored Nov 13, 2024
2 parents e6f5657 + 00c6295 commit 3a6aaa1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/WritingAssistant/WritingAssistant.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ const WritingAssistant: React.FC = () => {
<Popover>
<PopoverTrigger
style={{
top: `${highlightData.position.top}px`,
left: `${highlightData.position.left + 30}px`,
top: `${Math.max(highlightData.position.top + 30, 10)}px`,
left: `${Math.min(highlightData.position.left, window.innerWidth - 550)}px`,
zIndex: 50,
}}
className="absolute flex size-7 cursor-pointer items-center justify-center rounded-full border-none bg-gray-200 text-gray-600 shadow-md hover:bg-gray-300"
Expand All @@ -404,7 +404,7 @@ const WritingAssistant: React.FC = () => {
ref={optionsContainerRef}
style={{
position: 'absolute',
transform: 'translate(-50%, -50%)',
transform: 'translate(-50%, -40%)',
}}
className="absolute z-50 w-96 rounded-md border border-gray-300 bg-white p-2.5"
>
Expand Down

0 comments on commit 3a6aaa1

Please sign in to comment.