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

Fix for If riot is narrow enough, such that 'Send a message (unecrypted)' wraps to a second line, the timeline doesn't fit the window. #5900

Merged
merged 2 commits into from Jan 3, 2018

Conversation

Nostradamos
Copy link

@Nostradamos Nostradamos commented Jan 2, 2018

Problem was, that max-height/width and overflow was first set in .public-DraftEditor-content but we need it already before in .DraftEditor-root to also cover .public-DraftEditorPlaceholder-inner which holds the "The message is unencrypted..." text.
Fixes #4821
Last fix (PR: #5331) unfortunatly reintroduced #4652, for me multiline pasting works with this fix, but should be further tested.

@lukebarnard1
Copy link
Contributor

Having tested this, it seems to work, but unfortunately does still reintroduce #4652. The reason for this is (I think) that the DOM element that does the scrolling when it gets too thin has changed from being public-DraftEditor-content to public-DraftEditor-root (as per your PR).

In order to fix this, you may also need to edit this line: matrix-org/matrix-react-sdk@7e0fecb#diff-fa2e6c7a24d3ee8c284aa720b8f399edR466 such that the editor root is scrolled to the bottom instead of the editor content.

@Nostradamos
Copy link
Author

Nostradamos commented Jan 2, 2018

Thanks @lukebarnard1,
it seems like this is the problem. Changed your highlighted line(s) to:

            // Scroll to the bottom of the editor if the cursor is on the last line of the
            // composer. For some reason the editor won't scroll automatically if we paste
            // blocks of text in or insert newlines.
            if (textContent.slice(selection.start).indexOf("\n") === -1) {
                this.refs.editor.refs.editor.parentNode.parentNode.scrollTop = this.refs.editor.refs.editor.parentNode.parentNode.scrollHeight;
            }

And it seems to work. Will do another pull request against matrix-react-sdk for that. Not sure what to do with the long line, maybe needs some refactor.
matrix-react-sdk PR: matrix-org/matrix-react-sdk#1682

@lukebarnard1
Copy link
Contributor

(updated comment to correct PR ref)

@lukebarnard1 lukebarnard1 merged commit 604d4e0 into element-hq:develop Jan 3, 2018
lukebarnard1 added a commit to matrix-org/matrix-react-sdk that referenced this pull request Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants