File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
packages/app/src/app/pages/Sandbox/Editor/Workspace/screens/Comments/Dialog Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,16 @@ export const Dialog: React.FC = () => {
144144 />
145145 ) : null }
146146 </ Stack >
147- < AddReply comment = { comment } />
147+ < AddReply
148+ comment = { comment }
149+ onSubmit = { ( ) => {
150+ // scroll to bottom of the list,
151+ // have to wait for it to load though :)
152+ window . requestAnimationFrame ( ( ) => {
153+ listRef . current . scrollTop = listRef . current . scrollHeight ;
154+ } ) ;
155+ } }
156+ />
148157 </ >
149158 ) }
150159 </ Stack >
@@ -388,7 +397,7 @@ const Replies = ({ replies, repliesRenderedCallback }) => {
388397 ) ;
389398} ;
390399
391- const AddReply = ( { comment } ) => {
400+ const AddReply = ( { comment, ... props } ) => {
392401 const { actions } = useOvermind ( ) ;
393402 const [ value , setValue ] = useState ( '' ) ;
394403
@@ -398,6 +407,7 @@ const AddReply = ({ comment }) => {
398407 content : value ,
399408 parentCommentId : comment . id ,
400409 } ) ;
410+ if ( props . onSubmit ) props . onSubmit ( ) ;
401411 } ;
402412
403413 return (
You can’t perform that action at this time.
0 commit comments