-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A Button with only icon and external link does not show icon #181
Comments
Hi @david-nathanael, |
Looks like the issue only arrise when using remix icons... |
i didn't succeed even with fr icons. if it helps, my use case is to have a download button on the end of the row in a table. the link targets the api url, thats why its external. let me know how i can help. |
Sorry @david-nathanael, I got the wrong idea. Hello @lab9fr, You can see the reproduction here: https://stackblitz.com/edit/nextjs-yffvvb?file=pages%2Findex.tsx @david-nathanael The thing is react-dsfr automatically makes external links open in new tabs by default: Line 90 in 5df9212
|
@david-nathanael In the meantime you can sircumvent the problem by writing: <Button
iconId="fr-icon-account-circle-fill"
linkProps={{
href: 'https://google.com',
target: undefined,
rel: undefined,
}}
priority="tertiary no outline"
title="Label buttons"
/> This will probably make your user leave the website which isn't great. So maybe the best is to just do: <Button
iconId="fr-icon-account-circle-fill"
onClick={()=> window.open("https://google.com", '_blank');}
priority="tertiary no outline"
title="Label buttons"
/> The url won't be visibe at the bottom left of the screen when hovering the button and it won't be possible to do a right-click -> copy the link to clipboard but other thant that it will work.... |
thanks for the workaround. feel free to close the issue if you dont need it |
Hi, im assuming this is a bug. A button with an icon and an external link will not display the icon. It only displays the arrow indicating an external link.
https://stackblitz.com/edit/nextjs-ztzuot?file=pages%2Findex.tsx
Thanks
The text was updated successfully, but these errors were encountered: