Skip to content

Commit 7b05448

Browse files
Fix broken scroll on "Import wallet from recovery phrase" view (#2592) (#2608)
Co-authored-by: Miguel Nieto <miguelnietoarias3@gmail.com>
1 parent 05c2503 commit 7b05448

2 files changed

Lines changed: 13 additions & 29 deletions

File tree

extension/src/popup/views/RecoverAccount/index.tsx

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,17 @@ export const RecoverAccount = () => {
143143

144144
useEffect(() => {
145145
const phraseInputsArr: string[] = [];
146-
let PHRASE_LENGTH = SHORT_PHRASE;
146+
const PHRASE_LENGTH = isLongPhrase ? LONG_PHRASE : SHORT_PHRASE;
147147

148-
// delay to account for css transition
149-
setTimeout(() => {
150-
PHRASE_LENGTH = isLongPhrase ? LONG_PHRASE : SHORT_PHRASE;
151-
152-
for (let i = 1; i <= PHRASE_LENGTH; i++) {
153-
phraseInputsArr.push(`MnemonicPhrase-${i}`);
154-
}
155-
setPhraseInputs(phraseInputsArr);
148+
for (let i = 1; i <= PHRASE_LENGTH; i++) {
149+
phraseInputsArr.push(`MnemonicPhrase-${i}`);
150+
}
151+
setPhraseInputs(phraseInputsArr);
156152

157-
if (PHRASE_LENGTH === SHORT_PHRASE) {
158-
// when going back to 12 words, clear all the fields
159-
setMnemonicPhraseArr([]);
160-
}
161-
}, 150);
153+
if (PHRASE_LENGTH === SHORT_PHRASE) {
154+
// when going back to 12 words, clear all the fields
155+
setMnemonicPhraseArr([]);
156+
}
162157
}, [isLongPhrase]);
163158

164159
useEffect(() => {
@@ -253,13 +248,7 @@ export const RecoverAccount = () => {
253248
>
254249
<Card variant="primary">
255250
<div className="RecoverAccount__mnemonic-wrapper">
256-
<div
257-
className={`RecoverAccount__mnemonic-input ${
258-
isLongPhrase
259-
? "RecoverAccount__mnemonic-input--long-phrase"
260-
: ""
261-
}`}
262-
>
251+
<div className="RecoverAccount__mnemonic-input">
263252
{phraseInputs.map((phraseInput, i) => (
264253
<PhraseInput
265254
key={phraseInput}

extension/src/popup/views/RecoverAccount/styles.scss

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,18 @@
77
margin-top: #{pxToRem(121px)};
88

99
&__mnemonic-wrapper {
10-
overflow: scroll;
10+
overflow: auto;
1111
height: #{pxToRem(246px)};
12+
scrollbar-width: thin;
1213
}
1314

1415
&__mnemonic-input {
1516
display: flex;
1617
flex-wrap: wrap;
18+
justify-content: center;
1719
gap: #{pxToRem(6px)} #{pxToRem(16px)};
18-
max-height: #{pxToRem(244px)};
19-
overflow: hidden;
2020
padding: #{pxToRem(3px)} #{pxToRem(6px)};
2121
position: relative;
22-
transition: max-height var(--dropdown-animation);
23-
24-
&--long-phrase {
25-
max-height: 48rem;
26-
}
2722
}
2823

2924
&__phrase-input {

0 commit comments

Comments
 (0)