diff --git a/CHANGELOG.md b/CHANGELOG.md index c515547ab..3b304eccf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [10.9.3] +### Fixed +- Allow for scrolling when sign type data message is too long ([#13642](https://github.com/MetaMask/metamask-extension/pull/13642)) + - Require a scroll through of message before allowing user signature + ## [10.9.2] ### Fixed - Prevent errors on the swaps "View Quote" screen that can occur if the swaps API returns incorrect refund and max gas fees on some test networks ([#13511](https://github.com/MetaMask/metamask-extension/pull/13511)) @@ -2697,7 +2702,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Uncategorized - Added the ability to restore accounts from seed words. -[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.9.2...HEAD +[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v10.9.3...HEAD +[10.9.3]: https://github.com/MetaMask/metamask-extension/compare/v10.9.2...v10.9.3 [10.9.2]: https://github.com/MetaMask/metamask-extension/compare/v10.9.1...v10.9.2 [10.9.1]: https://github.com/MetaMask/metamask-extension/compare/v10.9.0...v10.9.1 [10.9.0]: https://github.com/MetaMask/metamask-extension/compare/v10.8.2...v10.9.0 diff --git a/package.json b/package.json index 2555ddaf8..2e5e8b5da 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metamask-crx", - "version": "10.9.2", + "version": "10.9.3", "private": true, "repository": { "type": "git", @@ -85,6 +85,7 @@ "3box/ipfs/prometheus-gc-stats/gc-stats/node-pre-gyp/tar": "^6.1.2", "3box/**/libp2p-crypto/node-forge": "^1.0.0", "3box/**/libp2p-keychain/node-forge": "^1.0.0", + "3box/ipfs/libp2p-webrtc-star/socket.io/engine.io": "^4.0.0", "analytics-node/axios": "^0.21.2", "analytics-node/axios/follow-redirects": "^1.14.7", "ganache-core/lodash": "^4.17.21", diff --git a/test/e2e/tests/signature-request.spec.js b/test/e2e/tests/signature-request.spec.js index bf2a547e2..6260f699d 100644 --- a/test/e2e/tests/signature-request.spec.js +++ b/test/e2e/tests/signature-request.spec.js @@ -1,5 +1,5 @@ const { strict: assert } = require('assert'); -const { withFixtures } = require('../helpers'); +const { withFixtures, regularDelayMs } = require('../helpers'); describe('Signature Request', function () { it('can initiate and confirm a Signature Request', async function () { @@ -59,6 +59,10 @@ describe('Signature Request', function () { ); // Approve signing typed data + await driver.clickElement( + '[data-testid="signature-request-scroll-button"]', + ); + await driver.delay(regularDelayMs); await driver.clickElement({ text: 'Sign', tag: 'button' }, 10000); await driver.waitUntilXWindowHandles(2); windowHandles = await driver.getAllWindowHandles(); diff --git a/ui/components/app/signature-request/signature-request-footer/index.scss b/ui/components/app/signature-request/signature-request-footer/index.scss index b1470d3e3..e679bef43 100644 --- a/ui/components/app/signature-request/signature-request-footer/index.scss +++ b/ui/components/app/signature-request/signature-request-footer/index.scss @@ -9,10 +9,16 @@ } button:first-child { - margin-left: 1rem; + flex: 1 1 100%; + padding: 0; } button:last-child { + flex: 1 1 100%; margin-right: 1rem; } + + &__tooltip { + display: flex; + } } diff --git a/ui/components/app/signature-request/signature-request-message/index.scss b/ui/components/app/signature-request/signature-request-message/index.scss index 3652addd1..14f8d4f39 100644 --- a/ui/components/app/signature-request/signature-request-message/index.scss +++ b/ui/components/app/signature-request/signature-request-message/index.scss @@ -1,7 +1,9 @@ .signature-request-message { flex: 1 60%; display: flex; + max-height: 250px; flex-direction: column; + position: relative; &__title { @include H6; @@ -56,4 +58,16 @@ &--node-leaf { display: flex; } + + &__scroll-button { + display: flex; + align-items: center; + justify-content: center; + background-color: var(--Grey-500); + position: absolute; + right: 24px; + bottom: 12px; + border-radius: 50%; + cursor: pointer; + } } diff --git a/ui/components/app/signature-request/signature-request-message/signature-request-message.component.js b/ui/components/app/signature-request/signature-request-message/signature-request-message.component.js index ca1056718..3c186f4c5 100644 --- a/ui/components/app/signature-request/signature-request-message/signature-request-message.component.js +++ b/ui/components/app/signature-request/signature-request-message/signature-request-message.component.js @@ -1,16 +1,41 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; +import { debounce } from 'lodash'; import classnames from 'classnames'; export default class SignatureRequestMessage extends PureComponent { static propTypes = { data: PropTypes.object.isRequired, + onMessageScrolled: PropTypes.func, + setMessageRootRef: PropTypes.func, + messageRootRef: PropTypes.object, + messageIsScrollable: PropTypes.bool, }; static contextTypes = { t: PropTypes.func, }; + state = { + messageIsScrolled: false, + }; + + setMessageIsScrolled = () => { + if (!this.props.messageRootRef || this.state.messageIsScrolled) { + return; + } + + const { scrollTop, offsetHeight, scrollHeight } = this.props.messageRootRef; + const isAtBottom = scrollTop + offsetHeight >= scrollHeight; + + if (isAtBottom) { + this.setState({ messageIsScrolled: true }); + this.props.onMessageScrolled(); + } + }; + + onScroll = debounce(this.setMessageIsScrolled, 25); + renderNode(data) { return (