-
Notifications
You must be signed in to change notification settings - Fork 439
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
Fix issue with the admin sidebar scrollbar on Firefox/Windows #2976
Conversation
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.
👍 Thanks @davide-negretti ! I've tested this and found no issues. So, I believe this to be a fix for Firefox on Windows. If we find further issues we can deal with them in future PRs.
@@ -108,4 +142,23 @@ export class RootComponent implements OnInit { | |||
mainContent.focus(); | |||
} | |||
} | |||
|
|||
getBrowserName(): string { | |||
const userAgent = this._window.nativeWindow.navigator.userAgent; |
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.
@davide-negretti : After merging this PR, I'm now noticing that I can get an error on this line when run via SSR:
ERROR TypeError: Cannot read properties of undefined (reading 'userAgent')
at RootComponent2.getBrowserName (C:\\dspace-angular\dist\server\main.js:1:1008203)
at RootComponent2.ngOnInit (C:\\dspace-angular\dist\server\main.js:1:1006659)
at callHookInternal (C:\\dspace-angular\dist\server\main.js:1:4134206)
To reproduce:
- Build in prod mode :
yarn build:prod; yarn serve:ssr
- Access the homepage & that SSR error will appear in the console window where you ran
yarn serve:ssr
.
Could you possibly provide a quick fix so that I don't have to revert this PR?
The following is an adaption of the DSpace 8.0 fix in the following pull requests for use in DSpace 7.6.2: * DSpace#2976 * DSpace#3004 The basic change is the same (detecting the browser and applying a particular CSS change for Firefox), but the files that are modified are different, due to changes in DSpace 8.0. https://umd-dit.atlassian.net/browse/LIBDRUM-872
The following is an adaption of the DSpace 8.0 fix in the following pull requests for use in DSpace 7.6.2: * DSpace#2976 * DSpace#3004 The basic change is the same (detecting the browser and applying a particular CSS change for Firefox), but the files that are modified are different, due to changes in DSpace 8.0. https://umd-dit.atlassian.net/browse/LIBDRUM-872
References
Description
This PR fixes the issues with the admin sidebar scrollbar on Firefox on Windows by allocating more space to the scrollbar.
List of changes
browser-firefox browser-firefox-windows
admin-sidebar
component the value of--ds-dark-scrollbar-width
is overridden whenbrowser-firefox-window
class is presentImplementation notes
Note that
--ds-dark-scrollbar-width
has two purposes:min-width: calc(var(--ds-admin-sidebar-collapsible-element-width) - var(--ds-dark-scrollbar-width));
)Additional notes
This PR allows to override any property of a CSS class as follows:
Currently only Safari and Firefox browsers and Windows OS are supported, but other browsers and OSs can be easily added.
Further improvements
This PR solves the issue, but further improvements are required to make the scrollbar width smaller: see this comment
Checklist
This checklist provides a reminder of what we are going to look for when reviewing your PR. You need not complete this checklist prior to creating your PR (draft PRs are always welcome). If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!
yarn lint
yarn check-circ-deps
)package.json
), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.