Skip to content
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

Anchor's span prop does not work #4695

Closed
arel opened this issue Aug 25, 2023 · 5 comments
Closed

Anchor's span prop does not work #4695

arel opened this issue Aug 25, 2023 · 5 comments

Comments

@arel
Copy link

arel commented Aug 25, 2023

What package has an issue

@mantine/core

Describe the bug

Using the span prop on an Anchor as in <Anchor span> has no effect. The resulting component is still an <a>.

Contrast this to setting the component explicitly, <Anchor component="span">, which does behave correctly.

Based on the documentation, I would expect that setting span or component="span" would behave the same.

What version of @mantine/hooks page do you have in package.json?

6.0.19

If possible, please include a link to a codesandbox with the reproduced problem

https://codesandbox.io/s/naughty-star-m98lv5?file=/src/App.tsx

Do you know how to fix the issue

None

Are you willing to participate in fixing this issue and create a pull request with the fix

None

Possible fix

No response

@jishat
Copy link

jishat commented Aug 26, 2023

But I see that you need to declare "component" as a key. Please share the link.

@arel
Copy link
Author

arel commented Aug 26, 2023

@jishat, I'm not sure I understood. When you set the component prop of an Anchor, it behaves correctly, but the issue happens when you set the span prop. It does not work as advertised.

        <Anchor span>This should be a span element but is not</Anchor>

The link to the documentation is: https://mantine.dev/core/anchor/?t=props

span, boolean, shorthand for component="span"

The link to the codesandbox is: https://codesandbox.io/s/naughty-star-m98lv5?file=/src/App.tsx

@jishat
Copy link

jishat commented Aug 26, 2023

Yes, you are right. It is a bug.

@jishat
Copy link

jishat commented Aug 26, 2023

I will can fix it. I am working on it

@rtivital
Copy link
Member

rtivital commented Sep 5, 2023

Fixed in 6.0.20, span prop was removed from Anchor component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants