-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: InlineLoading changes browser title to not loading due to missing svg #19469
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
base: main
Are you sure you want to change the base?
Conversation
All contributors have signed the DCO. |
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
I have read the DCO document and I hereby sign the DCO. |
<svg width="0" height="0" viewBox="0 0 0 0"> | ||
<title className={`${prefix}--inline-loading__inactive-status`}> | ||
{iconLabel} | ||
</title> | ||
</svg> |
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.
Is it correct to use a custom svg here that's effectively blank? Are there any accessibility implications related to the latter?
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.
To not effect the title element in the page that can cause page title change, it is essential to surround the svg to indicate it is title of SVG element, also it is consistent with the other spinning icons, you'll know when you change the status of the InlineLoading component.
if (status === 'error') { | ||
return ( | ||
element = ( |
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.
Per #19467, if the issue only affects the inactive status, why modify the handling for all other statuses? Is the issue more pervasive than reported?
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.
All others are in the animation wrapper, which "inactive" does not necessarily have an animation wrapper, to do so I had two options: 1) Not to change this return statement, but I have to additionally add another "if" to determine if it is not "inactive"; 2) change the whole piece of code to save 1 more logic check for only "inactive" status. So you can see in loading.animation = (<svg...</svg>)
removes <div className={`${prefix}--inline-loading__animation`}>{loading}</div>
wrapper for inactive
loading animation.
Closes #19467
Fixed the changed title of the tab when the status is set to
inactive
Changelog
New
Changed
svg
tag to wrap the title tag in order to fix the changes to the tab's titleRemoved
Testing / Reviewing
https://gqairvnmmrgithub-aszi--5173--4d9fd228.local-corp.webcontainer.io/
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
More details can be found in the pull request guide