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

docs: remove smoothscroll-polyfill as a recommendation #2020

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/dnb-design-system-portal/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import {
rootElement,
pageElement,
} from './src/core/PortalStylesAndProviders'
import smoothscroll from 'smoothscroll-polyfill'

smoothscroll.polyfill()

if (typeof window !== 'undefined') {
setIsTest(window.location)
Expand Down
3 changes: 1 addition & 2 deletions packages/dnb-design-system-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
"history": "5.1.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-live-ssr": "workspace:*",
"smoothscroll-polyfill": "0.4.4"
"react-live-ssr": "workspace:*"
},
"devDependencies": {
"@babel/core": "7.16.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,4 @@ GlobalStatusScrolling,

### To showcase the scrolling

Some browsers (Safari, Edge) will need a polyfill like `smoothscroll-polyfill`.

<GlobalStatusScrolling />
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ But You can also make use of the [FormSet](/uilib/components/form-set) or [FormR
</FormSet>
```

### Smooth scrolling

Not every browser (e.g. Safari, Edge, and IE) supports smooth scrolling. Therefore, add the [smoothscroll-polyfill](https://github.com/iamdustan/smoothscroll) to your project:

```js
import smoothscroll from 'smoothscroll-polyfill'

// kick off the polyfill!
smoothscroll.polyfill()
```

### Manually updates

Besides the automated connection between the error states of form components ([FormStatus](/uilib/components/form-status)), you can update messages from everywhere in your application at any time:
Expand Down Expand Up @@ -132,4 +121,4 @@ import { GlobalStatus } from '@dnb/eufemia/components'

// 3. and remove it again
<GlobalStatus.Remove id="custom-status" status_id="custom-id-1" />
```
```
8 changes: 0 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14488,7 +14488,6 @@ __metadata:
remark-gfm: 1.0.0
repo-utils: "workspace:*"
sass: 1.43.4
smoothscroll-polyfill: 0.4.4
start-server-and-test: 1.15.4
storybook-utils: "workspace:*"
stylelint: 15.1.0
Expand Down Expand Up @@ -31571,13 +31570,6 @@ __metadata:
languageName: node
linkType: hard

"smoothscroll-polyfill@npm:0.4.4":
version: 0.4.4
resolution: "smoothscroll-polyfill@npm:0.4.4"
checksum: b99ff7d91689d563ec69cb1d29713b332a24c88ac3dc4ef9ef9fbe4137305336e67253211067c5f786478dbdabd2aa6c2033709d4d8feca327b09eca8d5a0e7b
languageName: node
linkType: hard

"snake-case@npm:^2.1.0":
version: 2.1.0
resolution: "snake-case@npm:2.1.0"
Expand Down