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

Moving up and down via shortcuts does not work in Firefox #176

Closed
matejdro opened this issue Apr 3, 2021 · 16 comments
Closed

Moving up and down via shortcuts does not work in Firefox #176

matejdro opened this issue Apr 3, 2021 · 16 comments
Labels
bug Something isn't working

Comments

@matejdro
Copy link

matejdro commented Apr 3, 2021

When attempting to move task up or down via Shift + Up/Down/j/k, task will just blink in place, but will not move.

This is with Firefox 87.0 and todoist shortcuts 128.

@mgsloan
Copy link
Owner

mgsloan commented Apr 8, 2021 via email

@matejdro
Copy link
Author

matejdro commented Apr 8, 2021

I can move tasks with mouse with no problems, so it's not the sorting.

@matejdro
Copy link
Author

matejdro commented Apr 8, 2021

Are there any logs or anything else I can give you to help sort out the issue?

@mgsloan
Copy link
Owner

mgsloan commented Apr 8, 2021 via email

@matejdro
Copy link
Author

matejdro commented Apr 8, 2021

Huh it seems to work now. Maybe it was an update from Todoist that messed up something before. Thanks for your help.

@matejdro matejdro closed this as completed Apr 8, 2021
@matejdro
Copy link
Author

matejdro commented Apr 17, 2021

This is still happening, but only in one project (can't find anything different in that project). Here is the debug log of me trying to move a task up with Shift + K:

todoist-shortcuts: keydownHandler 
keydown Shift { target: body.with_new_emoji_sizing
, key: "K", charCode: 0, keyCode: 75 }
vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.242 todoist-shortcuts: ignoring scroll vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.242 todoist-shortcuts: moveUp target is 
<li id="task-4751098710" class="task_list_item task_list_item--project_hidden" data-selection-id="4751098710" aria-selected="false" data-item-id="4751098710" data-item-indent="1" style="">
vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.261 todoist-shortcuts: viewMode =  project vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.262 todoist-shortcuts: ignoring mutations since drag is in progress: 
Array [ MutationRecord ]
vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.267 todoist-shortcuts: handleMouseMove ignoring synthetic mouse move event. 11 vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.332 todoist-shortcuts: restoring scroll vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.332 todoist-shortcuts: Checking if cursor still exists: 4751839266 indent_1 vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.333 todoist-shortcuts: Cursor hasn't changed task: currentSection =  <empty string> lastCursorSection =  <empty string> id = 4751839266 indent = indent_1 vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.333 todoist-shortcuts: Found normal cursor, so storing its context vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.333 todoist-shortcuts: wrote down cursor context: id = 4751839266 indent = indent_1 section = <empty string> idx = 31 vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.350 todoist-shortcuts: viewMode =  project vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.351 todoist-shortcuts: ensuring cursor due to mutations: 
Array [ MutationRecord ]
vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.351 todoist-shortcuts: Checking if cursor still exists: 4751839266 indent_1 vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.351 todoist-shortcuts: Cursor hasn't changed task: currentSection =  <empty string> lastCursorSection =  <empty string> id = 4751839266 indent = indent_1 vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.352 todoist-shortcuts: Found normal cursor, so storing its context vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.352 todoist-shortcuts: wrote down cursor context: id = 4751839266 indent = indent_1 section = <empty string> idx = 31 vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.400 todoist-shortcuts: Checking if cursor still exists: 4751839266 indent_1 vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.401 todoist-shortcuts: Cursor hasn't changed task: currentSection =  <empty string> lastCursorSection =  <empty string> id = 4751839266 indent = indent_1 vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.401 todoist-shortcuts: Found normal cursor, so storing its context vendor.f3cab33e857221b9f96a.js:1:366360
07:56:42.401 todoist-shortcuts: wrote down cursor context: id = 4751839266 indent = indent_1 section = <empty string> idx = 31 vendor.f3cab33e857221b9f96a.js:1:366360

EDIT: Logging out and back in fixed it. Can you get anything from above logs?

EDIT2: Broken again. it seems to happen intermittently.

@matejdro matejdro reopened this Apr 17, 2021
@GaryFurash
Copy link

Same issue - in Inbox w/ no sort enabled in chrome. none of the move lines work. Works with edge for some reason.

@mgsloan
Copy link
Owner

mgsloan commented Jul 24, 2021 via email

@matejdro
Copy link
Author

The only browsers available to me are chrome and firefox, so I can't straightforwardly work on this.

Well, I'm having issue in Firefox and @GaryFurash has an issue in Chrome, so I don't think this is an issue ;)

Any chance you could make a branch with more logging enabled? That way I can install this and give you more logs on what is going on.

@mgsloan
Copy link
Owner

mgsloan commented Jul 25, 2021 via email

@mgsloan mgsloan added the bug Something isn't working label Jul 25, 2021
@matejdro
Copy link
Author

I've given you debug logs above. Or do you want me to retry this with newer builds (maybe you added more logging statements?)?

@mgsloan
Copy link
Owner

mgsloan commented Sep 27, 2021

Sorry, since I have no idea how to reproduce the bug, I can't really work on fixing it.

@matejdro
Copy link
Author

Right, but we can reproduce it for you and give you all the necessary data to fix it.

@matejdro
Copy link
Author

matejdro commented Feb 5, 2022

@mgsloan I've been trying to debug it and the issue appears to be in the offset method. Sometimes, offset methods does not appear to provide proper Y for the emulated mouse cursor (it is hundreds off) and it thus attempts to move it to a wrong position.

Changing offset method to the following code fixes the shifting issue:

  function offset(el) {
    let bounds = el.getBoundingClientRect();
    return {x: bounds.x, y: bounds.y};
  }

however, this change causes different issues (just moving up or down with j and k causes page to randomly scroll around).

Do you have any idea what could cause the offset method to break? I can try inserting extra debug statements.

@mgsloan
Copy link
Owner

mgsloan commented Feb 6, 2022

Fix will be in version 142! Thanks matejdro!

I can now reproduce this issue. The problem happens when there are enough tasks in a project to allow scrolling, and the window is scrolled down.

I've kept the "put task in view" code using the old implementation of offset, and used matejdro's offset code for task movement.

mgsloan added a commit that referenced this issue Feb 6, 2022
Thanks to [matejdro][] for identifying that client offsets work
better for task movement in Firefox.

[matejdro]: https://github.com/matejdro
mgsloan added a commit that referenced this issue Feb 6, 2022
@matejdro
Copy link
Author

matejdro commented Feb 7, 2022

That's amazing, thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants