-
Notifications
You must be signed in to change notification settings - Fork 42
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
Bugfix/button loading issue in modal #3252
Conversation
Making this change because widthOverride sometimes gets set to 0 (should also be fixed), meaning this check fails as "falsy".
…odals Checking that width is truthy (not zero) will avoid issue where widthOverride gets set to 0 because the button is not yet rendered.
🦋 Changeset detectedLatest commit: ce25ccd The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Storybook demo / Chromatic68b13d5a9 | 91 components | 135 stories |
…absolutely positioning the loading icon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dispute the approval since this hasn't been fixed yet 😅
Co-authored-by: Ken <[email protected]>
…very specific item.
…ly child (hidden), because of the loader icon. Instead checks for no label. Could consider :not(:has(:is(.navds-button__icon, .navds-loader))) as well, to be more robust, but it might be overkill.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the only thing left is to update button.darkside.css as well 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was about to comment that. 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a quick edit for darkside. I'll welcome suggested improvements, e.g. for nesting choices.
…ough filteredProps and then overridden afterwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or wait, unapprove since darkside.css isn't done yet? (as mentioned)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Fix edge-case issue with setting
loading={true}
on a Button in a Modal on page load. (Why would anyone do this?)Button would get
width: 0
because the width is calculated before the button is rendered.This also caused the spinner not to show, because we checked
widthOverride
instead of theloading
prop.Component Checklist 📝
@navikt/core/css/config/_mappings.js
)@navikt/core/css/tokens.json
)@navikt/aksel-stylelint/src/deprecations.ts
)@navikt/core/react/src/index.ts
and@navikt/core/react/package.json
)@navikt/core/css/index.css
)<Component>: <gitmoji?> <Text>.
E.g. "Button: ✨ Add feature xyz.")