Skip to content

Commit

Permalink
Merge pull request #1410 from RodriSanchez1/fix/OutputBarAutoScroll
Browse files Browse the repository at this point in the history
Fix/output bar auto scroll
  • Loading branch information
RodriSanchez1 authored Mar 13, 2023
2 parents d35b635 + 3a681ad commit b30c305
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
RedditShareButton,
RedditIcon
} from 'react-share';
import withMobileDialog from '@material-ui/core/withMobileDialog';
import messages from './PhraseShare.messages';

import './PhraseShare.css';
Expand Down Expand Up @@ -144,4 +143,4 @@ PhraseShare.propTypes = {
onCopyPhrase: PropTypes.func
};

export default withMobileDialog()(PhraseShare);
export default PhraseShare;
6 changes: 2 additions & 4 deletions src/components/Board/Output/SymbolOutput/SymbolOutput.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ class SymbolOutput extends PureComponent {
try {
const lastOutputSymbol = this.scrollContainerRef.current.lastElementChild;
lastOutputSymbol.scrollIntoView({
behavior: 'smooth',
inline: 'start'
inline: 'end'
});
} catch (err) {
console.error('Error during autoScroll of output bar', err);
}
};

componentDidMount() {
//using a setTimeout to propperly works of scroll in to view depending of screen size render
setTimeout(this.scrollToLastSymbol, 200);
this.scrollToLastSymbol();
}

componentDidUpdate(prevProps) {
Expand Down

0 comments on commit b30c305

Please sign in to comment.