Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

[FIX] - Use Ref instead of a constant #2715

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

eniskraasniqi1
Copy link
Contributor

@eniskraasniqi1 eniskraasniqi1 commented Jul 13, 2023

Description

Reverts two files (WysiwygEditor.tsx & TabGroup.tsx) from this PR. It also fixes the tab group bug, where the scroll wasn't working as it should.

As per my understanding, the reason why this happened:

Since ref is mutable, when referencing ref.current inside a function (in our case checkForScrollPosition) it will likely generate a new reference of the function between re-renders. But if you use a constant instead, that won't happen.

SCR-20230713-lfv

@eniskraasniqi1 eniskraasniqi1 self-assigned this Jul 13, 2023
@eniskraasniqi1 eniskraasniqi1 changed the title [FIX] - Use ref.current instead of a constant [FIX] - Use Ref instead of a constant Jul 13, 2023
@eniskraasniqi1 eniskraasniqi1 marked this pull request as ready for review July 13, 2023 14:27
@eniskraasniqi1 eniskraasniqi1 requested review from a team, jelledc, lorgan3, KristofColpaert, qubis741 and BeirlaenAaron and removed request for a team July 13, 2023 14:28
@eniskraasniqi1 eniskraasniqi1 merged commit aef0530 into next-release Jul 14, 2023
6 checks passed
@eniskraasniqi1 eniskraasniqi1 deleted the tab-group-scrolling-fix branch July 14, 2023 05:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants