Skip to content

Commit 8531a73

Browse files
authored
[core-v2.9.1-alpha.2, react-v2.3.7-alpha.2, vue-v2.2.7-alpha.2, hw-common-v2.0.4-alpha.1, all HW wallet pkgs]: Fix - Mobile scroll issue on modal close (#1317)
* Refactor background scroll logic when connect modal is opened/closed * Align account select modal with connect modal * Clean up demo for small screens * Bump hw-common version * Bump hw package versions
1 parent 4a20f2e commit 8531a73

File tree

14 files changed

+36
-47
lines changed

14 files changed

+36
-47
lines changed

packages/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/core",
3-
"version": "2.9.1-alpha.1",
3+
"version": "2.9.1-alpha.2",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -92,7 +92,7 @@
9292
"lodash.merge": "^4.6.2",
9393
"lodash.partition": "^4.6.0",
9494
"nanoid": "^4.0.0",
95-
"rxjs": "^7.5.2",
95+
"rxjs": "^7.5.5",
9696
"svelte": "^3.49.0",
9797
"svelte-i18n": "^3.3.13"
9898
}

packages/core/src/views/shared/Modal.svelte

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,37 +16,16 @@
1616
<script lang="ts">
1717
import { fade } from 'svelte/transition'
1818
import { onDestroy, onMount } from 'svelte'
19-
import { configuration } from '../../configuration.js'
2019
21-
const { device } = configuration
22-
23-
const body = document.body
2420
const html = document.documentElement
25-
const trackYScrollPosition = () => {
26-
document.documentElement.style.setProperty(
27-
'--scroll-y',
28-
`${window.scrollY}px`
29-
)
30-
}
31-
3221
onMount(() => {
33-
window.addEventListener('scroll', trackYScrollPosition, { passive: true })
34-
const scrollY = html.style.getPropertyValue('--scroll-y')
35-
device.type === 'mobile'
36-
? (html.style.position = 'fixed')
37-
: (html.style.overflow = 'hidden')
38-
39-
body.style.top = `-${scrollY}`
22+
html.style.position = 'sticky'
23+
html.style.overflow = 'hidden'
4024
})
4125
4226
onDestroy(() => {
43-
device.type === 'mobile'
44-
? (html.style.position = '')
45-
: html.style.removeProperty('overflow')
46-
const scrollY = body.style.top
47-
body.style.top = ''
48-
window.scrollTo(0, parseInt(scrollY || '0') * -1)
49-
window.removeEventListener('scroll', trackYScrollPosition)
27+
html.style.position = ''
28+
html.style.removeProperty('overflow')
5029
})
5130
export let close: () => void
5231
</script>

packages/dcent/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/dcent",
3-
"version": "2.2.1",
3+
"version": "2.2.2-alpha.1",
44
"description": "D'CENT wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -57,7 +57,7 @@
5757
},
5858
"dependencies": {
5959
"@web3-onboard/common": "^2.2.3",
60-
"@web3-onboard/hw-common": "^2.0.3",
60+
"@web3-onboard/hw-common": "^2.0.4-alpha.1",
6161
"@ethereumjs/tx": "^3.4.0",
6262
"@ethersproject/providers": "^5.5.0",
6363
"eth-dcent-keyring": "^0.2.2"

packages/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"@web3-onboard/coinbase": "^2.1.3",
26-
"@web3-onboard/core": "^2.9.1-alpha.1",
26+
"@web3-onboard/core": "^2.9.1-alpha.2",
2727
"@web3-onboard/dcent": "^2.2.1",
2828
"@web3-onboard/fortmatic": "^2.0.14",
2929
"@web3-onboard/gas": "^2.1.3",

packages/demo/src/App.svelte

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
import blocknativeLogo from './blocknative-logo'
3131
import { onMount } from 'svelte'
3232
33+
let windowWidth
34+
3335
if (window.innerWidth < 700) {
3436
new VConsole()
3537
}
@@ -672,7 +674,6 @@
672674
overflow: hidden;
673675
width: 2em;
674676
height: 2em;
675-
/* optional formatting below here */
676677
border-radius: 50%;
677678
box-shadow: 1px 1px 3px 0px grey;
678679
margin: 1em;
@@ -762,6 +763,8 @@
762763
}
763764
</style>
764765
766+
<svelte:window bind:innerWidth={windowWidth} />
767+
765768
<main>
766769
{#if hideForIframe}
767770
<div id="image_drop_area">
@@ -1020,9 +1023,9 @@
10201023
</div>
10211024
{/each}
10221025
{/if}
1023-
{#if !hideForIframe}
1026+
{#if !hideForIframe && windowWidth > 1040}
10241027
<div class="themes">
1025-
<label for="Theme">Click Color Circles to Set Theme: </label>
1028+
<label for="Theme">Click Colored Circles to Set Theme: </label>
10261029
<div class="theming-container">
10271030
{#each Object.keys(defaultStyling) as target}
10281031
<div class="theming-inputs-wrapper">

packages/hw-common/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/hw-common",
3-
"version": "2.0.3",
3+
"version": "2.0.4-alpha.1",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",

packages/hw-common/src/views/AccountSelect.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
var(--onboard-font-family-normal, var(--font-family-normal))
275275
);
276276
color: var(--account-select-black, var(--onboard-black, var(--black)));
277-
position: absolute;
277+
position: fixed;
278278
top: 0;
279279
right: 0;
280280
z-index: var(

packages/keepkey/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/keepkey",
3-
"version": "2.3.1",
3+
"version": "2.3.2-alpha.1",
44
"description": "KeepKey hardware wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -64,7 +64,7 @@
6464
"@shapeshiftoss/hdwallet-core": "^1.15.2",
6565
"@shapeshiftoss/hdwallet-keepkey-webusb": "^1.15.2",
6666
"@web3-onboard/common": "^2.2.3",
67-
"@web3-onboard/hw-common": "^2.0.3",
67+
"@web3-onboard/hw-common": "^2.0.4-alpha.1",
6868
"ethereumjs-util": "^7.1.3"
6969
}
7070
}

packages/keystone/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/keystone",
3-
"version": "2.3.1",
3+
"version": "2.3.2-alpha.1",
44
"description": "Keystone hardware wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -59,6 +59,6 @@
5959
"@ethersproject/providers": "^5.5.0",
6060
"@keystonehq/eth-keyring": "^0.14.00.3",
6161
"@web3-onboard/common": "^2.2.3",
62-
"@web3-onboard/hw-common": "^2.0.3"
62+
"@web3-onboard/hw-common": "^2.0.4-alpha.1"
6363
}
6464
}

packages/ledger/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/ledger",
3-
"version": "2.3.1",
3+
"version": "2.3.2-alpha.1",
44
"description": "Ledger hardare wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -66,7 +66,7 @@
6666
"@ledgerhq/hw-transport-webusb": "^6.19.0",
6767
"@metamask/eth-sig-util": "^4.0.0",
6868
"@web3-onboard/common": "^2.2.3",
69-
"@web3-onboard/hw-common": "^2.0.3",
69+
"@web3-onboard/hw-common": "^2.0.4-alpha.1",
7070
"buffer": "^6.0.3",
7171
"ethereumjs-util": "^7.1.3"
7272
}

packages/react/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/react",
3-
"version": "2.3.7-alpha.1",
3+
"version": "2.3.7-alpha.2",
44
"description": "A collection of React hooks for integrating Web3-Onboard in to React and Next.js projects. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -62,7 +62,7 @@
6262
"typescript": "^4.5.5"
6363
},
6464
"dependencies": {
65-
"@web3-onboard/core": "^2.9.1-alpha.1",
65+
"@web3-onboard/core": "^2.9.1-alpha.2",
6666
"@web3-onboard/common": "^2.2.3",
6767
"use-sync-external-store": "1.0.0"
6868
},

packages/trezor/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/trezor",
3-
"version": "2.3.1",
3+
"version": "2.3.2-alpha.1",
44
"description": "Trezor hardware wallet module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -61,7 +61,7 @@
6161
"@ethereumjs/tx": "^3.4.0",
6262
"@ethersproject/providers": "^5.5.0",
6363
"@web3-onboard/common": "^2.2.3",
64-
"@web3-onboard/hw-common": "^2.0.3",
64+
"@web3-onboard/hw-common": "^2.0.4-alpha.1",
6565
"buffer": "^6.0.3",
6666
"eth-crypto": "^2.1.0",
6767
"ethereumjs-util": "^7.1.3",

packages/vue/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/vue",
3-
"version": "2.2.7-alpha.1",
3+
"version": "2.2.7-alpha.2",
44
"description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -63,7 +63,7 @@
6363
"@vueuse/core": "^8.4.2",
6464
"@vueuse/rxjs": "^8.2.0",
6565
"@web3-onboard/common": "^2.2.3",
66-
"@web3-onboard/core": "^2.9.1-alpha.1",
66+
"@web3-onboard/core": "^2.9.1-alpha.2",
6767
"vue-demi": "^0.12.4"
6868
},
6969
"peerDependencies": {

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9263,6 +9263,13 @@ rxjs@^7.5.2:
92639263
dependencies:
92649264
tslib "^2.1.0"
92659265

9266+
rxjs@^7.5.5:
9267+
version "7.5.7"
9268+
resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.7.tgz#2ec0d57fdc89ece220d2e702730ae8f1e49def39"
9269+
integrity sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==
9270+
dependencies:
9271+
tslib "^2.1.0"
9272+
92669273
sade@^1.7.4:
92679274
version "1.8.1"
92689275
resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701"

0 commit comments

Comments
 (0)