Open wbruntra opened 2 years ago
My bad. The div
in the component can just be changed to a span
. It's there to make the text opacity 0 for async actions, so the button doesn't change size.
In that case, I don't think we can use the CircularProgress
within the button either as it wraps the spinner within a div
and I'm not sure there's a way to override the underlying element used for its container...
Tbh, I just meant that @wbruntra put an 'a' tag inside 'button' tag, and you noticed this div :)
CircularProgress
from Mui
is made of span and svg,
In that case, I don't think we can use the
CircularProgress
within the button either as it wraps the spinner within adiv
and I'm not sure there's a way to override the underlying element used for its container...
Looks like in mui v4 it uses a div
, but in v5 it uses a span
, so perhaps better to just ignore this issue for now? It will eventually fix itself.
In that case, I don't think we can use the
CircularProgress
within the button either as it wraps the spinner within adiv
and I'm not sure there's a way to override the underlying element used for its container...Looks like in mui v4 it uses a
div
, but in v5 it uses aspan
, so perhaps better to just ignore this issue for now? It will eventually fix itself.
true, I looked at v5 and not v4 xp yeah, I think the CircularProgress can stay as it is for now, and only change this div https://github.com/Couchers-org/couchers/blob/develop/app/web/src/components/Button/Button.tsx#L87
As discovered by @goskan93, (https://github.com/Couchers-org/couchers/pull/2037) the custom
Button
component renders adiv
by default, which is invalid inside abutton
(https://stackoverflow.com/questions/51755195/is-it-a-valid-markup-to-put-some-tags-inside-button-tag).So it seems the
Button
component needs to be redesigned.