Skip to content

Commit

Permalink
Added scroll to top for created setups links (#2730)
Browse files Browse the repository at this point in the history
in both SSO and Dsync flows

Co-authored-by: Deepak Prabhakara <deepak@boxyhq.com>
  • Loading branch information
nitendra-new and deepakprabhakara committed May 24, 2024
1 parent 7ccd7b0 commit ce565c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal-ui/src/setup-link/SetupLinkInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const SetupLinkInfo = ({ setupLink, onClose }: { setupLink: SetupLink; on
<Card className='border-primary'>
<Card.Body>
<div>
<InputWithCopyButton text={setupLink.url} label={t('bui-sl-share-info')} />
<InputWithCopyButton text={setupLink.url} label={t('bui-sl-share-info')} autofocus={true} />
</div>
<div>
<Button size='sm' color='primary' onClick={onClose}>
Expand Down
11 changes: 10 additions & 1 deletion internal-ui/src/shared/InputWithCopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ export const CopyToClipboardButton = ({ text }: { text: string }) => {
);
};

export const InputWithCopyButton = ({ text, label }: { text: string; label: string }) => {
export const InputWithCopyButton = ({
text,
label,
autofocus = false,
}: {
text: string;
label: string;
autofocus?: boolean;
}) => {
const id = label.replace(/ /g, '');
return (
<>
Expand All @@ -36,6 +44,7 @@ export const InputWithCopyButton = ({ text, label }: { text: string; label: stri
key={text}
readOnly
className='input-bordered input w-full text-sm'
autoFocus={autofocus}
/>
</>
);
Expand Down

0 comments on commit ce565c4

Please sign in to comment.