I am not a front-end expert, but it seems you are right that this is a bug.


Vladimir Prus <vladimir.p...@gmail.com> 于2021年6月30日周三 上午4:00写道:

> Hi,
>
> lots of colleagues (myself included) are observing the following annoying
> behaviour:
> - you are busy typing fancy Spark code in a notebook
> - all of sudden, recently written code disappears and cursor jumps to the
> start of the paragraph
>
> The cursor jump suggests that paragraph text is unintentionally updated,
> and looking at console logs suggests that maybe, UI sends "commit
> paragraph" to the server, receives new paragraph, and updates the text in
> UI to an earlier version. So, I looked at the code in
> paragraph.controller.js and see this
>
> if ($scope.dirtyText === newPara.text) {  // when local update is the same 
> from remote, clear local update
>   $scope.paragraph.text = newPara.text;
>   $scope.dirtyText = undefined;
>   $scope.originalText = angular.copy(newPara.text);
> } else { // if there're local update, keep it.
>   $scope.paragraph.text = newPara.text;
> }
>
>
> It seems there's the intention to preserve local changes, but then the
> last line still assigns newPara.text to paragraph. Is this just a thinko
> and the last line is a bug, and must be basically removed (so keep current
> paragraph.text and dirtyText). Or am I misunderstanding all this?
>
>
> --
> Vladimir Prus
> http://vladimirprus.com
>


-- 
Best Regards

Jeff Zhang

Reply via email to