Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-1360

a focus position in a formula editor is reset when other users edit cells under the collaboration mode

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 3.9.2
    • Fix Version/s: 3.9.4
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      Steps to Reproduce

      1. enable collaboration mode
      2. user X and user Y open the same file
      3. user X edit A1 via formula editor .zsformulabar-editor-real, the cursor is at the end of the formula editor
      (do NOT leave the cursor)
      4. during user X is editing in the formula editor, user Y modify another cell e.g. C1

      Current Result

      user X's cursor jumps to the start of the formula editor

      Expected Result

      user A's cursor doesn't change its position

      Debug Information

      empty (zk.wpd:formatted:3892)
      jq.fn.(anonymous function) (zk.wpd:formatted:7574)
      (anonymous) (zk.wpd:formatted:3929)
      access (zk.wpd:formatted:543)
      html (zk.wpd:formatted:3908)
      setValue (zss.wpd:16)
      _onContentsChanged (zss.wpd:16)
      (anonymous) (zk.wpd:formatted:7030)
      fireX (zk.wpd:formatted:13703)
      fire (zk.wpd:formatted:13749)
      $supers (zk.wpd:formatted:7069)
      fire (zss.wpd:37)
      onResponse (zss.wpd:2)
      ...

      debug

      • user Y edits a cell in a different sheet doesn't reset user X's cursor.

      Workaround

      edit cells with inline editbox

        Activity

        Hide
        hawk hawk added a comment - - edited

        root cause

        • the process
          1. user X edits a cell
          2. (userX browser) fire onStopEdit to server
          3. (server) generate cell data
          e.g. cell {row: 11, column: 0}

          but it updates

          {left:10, right:11, top:0, bottom:1}

          4. (userY clbrowserient) receive and update cell data
          SSheetCtrl._cmdCellUpdate()
          5. (userY browser) fires onContentsChange event
          6. (userY browser) FormulabarEditor set value, so reset the cursor

        debug info

        • try to ignore the content change from different sheet & cell.
          1. an edit from a different sheet doesn't fire onContentsChange in the current sheet
          2. in FormulabarEditor._onContentsChanged(), no way to get server generated cell data, so no way to determine which range is updated of this content change.

        solution

        When a user is editing formulabar, FormulabarEditor doesn't accept a content change.
        this behavior matches Editbox, when you are editing in Editbox, it doesn't change its content by other collaborators.

        • only one user, it's impossible that content change and editing FormulabarEditor happens at the same time.
        • under collaboration mode, when userX edits A1 in a FormulabarEditor, and userY completes his edit at A1, userX can't see the change immediately. But userX can see the updated cell value if he cancels the edit.
        Show
        hawk hawk added a comment - - edited root cause the process 1. user X edits a cell 2. (userX browser) fire onStopEdit to server 3. (server) generate cell data e.g. cell {row: 11, column: 0} but it updates {left:10, right:11, top:0, bottom:1} 4. (userY clbrowserient) receive and update cell data SSheetCtrl._cmdCellUpdate() 5. (userY browser) fires onContentsChange event 6. (userY browser) FormulabarEditor set value, so reset the cursor debug info try to ignore the content change from different sheet & cell. 1. an edit from a different sheet doesn't fire onContentsChange in the current sheet 2. in FormulabarEditor._onContentsChanged() , no way to get server generated cell data, so no way to determine which range is updated of this content change. solution When a user is editing formulabar, FormulabarEditor doesn't accept a content change. this behavior matches Editbox, when you are editing in Editbox, it doesn't change its content by other collaborators. only one user, it's impossible that content change and editing FormulabarEditor happens at the same time. under collaboration mode, when userX edits A1 in a FormulabarEditor, and userY completes his edit at A1, userX can't see the change immediately. But userX can see the updated cell value if he cancels the edit.

          People

          • Assignee:
            hawk hawk
            Reporter:
            hawk hawk
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: