Menu

#4622 (ok 4.3.3) Cannot remove table ordering on a Mac

4.3.2
fixed
None
1
2014-12-21
2014-12-06
No

If you sort a table by a column, you cannot remove that sorting on a Mac. Ctrl+Click opens the context menu instead. The only way is to delete entries from phpmyadmin.pma__table_uiprefs, then log out and log back in again.

Tested on PMA 4.3.0 in both Chrome and Firefox (Mac OSX Yosemite 10.10.1) with the same result.

Discussion

  • Marc Delisle

    Marc Delisle - 2014-12-14

    DisgruntledGoat,
    would it make sense to use Command+click ? If so, can you make a test?

    The patch for 4.3.2:
    diff --git a/js/multi_column_sort.js b/js/multi_column_sort.js
    index 9fc4c1b..bb4083d 100644
    --- a/js/multi_column_sort.js
    +++ b/js/multi_column_sort.js
    @@ -59,7 +59,7 @@ function removeColumnFromMultiSort(target, parent)
    AJAX.registerOnload('keyhandler.js', function () {
    $("th.draggable.column_heading.pointer.marker a").on('click', function (eve
    var url = $(this).parent().find('input').val();

    • if (event.ctrlKey) {
    • if (event.ctrlKey || event.metaKey) {
      event.preventDefault();
      url = removeColumnFromMultiSort(url, $(this).parent());
      if (url) {
     
  • Isaac Bennetch

    Isaac Bennetch - 2014-12-15

    I'm testing with Firefox at the moment.

    I tried that patch and encountered some strange behavior. For a brief moment, it seems to work -- then the page appears to reload with the original order. Prior to the refresh, I could actually see the unordered SQL query, but the page refreshes almost immediately. At first I thought this was because command-click is normally the "open link in a new tab" shortcut.

    I think perhaps option-click is a better solution here. According to this, the option key is altKey, but I do not believe that is true. The 'option' key is dual-purpose, 'option' by itself is a different keystroke than shift-option which is really 'alt'. I'd prefer to leave this on the un-shifted 'option' keystroke; altKey refers to the shifted 'alt' keystroke. When I tested, the shift-alt keystroke was required when the code referred to altKey.

    Five minutes of web searching has not resulted in me finding the proper keyword to refer to the un-shifted 'option' key. Furthermore, testing at https://api.jquery.com/keydown/#target shows the only difference between what I would consider 'option' and 'alt' is that shiftKey is true for 'alt' but false for 'option' -- both show key: Alt and keyCode: 18.

     
  • Marc Delisle

    Marc Delisle - 2014-12-15

    Isaac,
    do you get the same results with Chrome?

     
  • Isaac Bennetch

    Isaac Bennetch - 2014-12-15

    Yes, I've now tested with Chrome, Firefox, and Safari and all three have the same behavior.

    • Control is universally the contextual menu
    • Command is universally the "open link in new tab" shortcut and I'm not sure whether we could override that or if doing so would be a good idea
    • altKey refers to the key combination shift-option in all three browsers tested. Forcing the user to press two keys at the same time is not unheard of but doesn't seem ideal to me.

    Hope that helps.

     
  • Marc Delisle

    Marc Delisle - 2014-12-15

    Isaac,
    yes that helps a lot. In these browsers, did you try a variation of the patch:
    if (event.ctrlKey || event.altKey) {
    to see if the behavior is correct?
    Even if it's not ideal, what other choice do we have? If we adopt it, it would be a matter of advertising the new key combination in the hint and changing the "if" statement as stated above.

     
    • Isaac Bennetch

      Isaac Bennetch - 2014-12-15

      Yes, I did try that variation.

      The only better solution I can think of is if we can determine when the option key is pressed without using shift. I haven't been able to find that solution yet, so I'm not sure it's possible. It may be a modifier key that doesn't register a keypress event. I would say if I can't find find a better solution by this afternoon that we should go ahead with the event.ctrlKey || event.altKey solution.

      We should then modify the tooltip text, I propose Alt+click (on Mac that is the shift+option keys) to remove...

       
  • Marc Delisle

    Marc Delisle - 2014-12-15

    Do you mean to replace ctrl+click also on non-Mac machines?
    I tested in Windows 7 (Firefox 31 and IE 11) and altKey is triggered by Alt+Shift.

     

    Last edit: Marc Delisle 2014-12-15
    • Isaac Bennetch

      Isaac Bennetch - 2014-12-15

      Do you mean to replace ctrl+click also on non-Mac machines?

      That is how my tooltip sounds, but that is because I didn't consider that when writing it. No, I do not wish to replace ctrl-click.

      So the text could possibly become:
      Ctrl+click or alt+click to remove...
      or
      Ctrl+click (Mac users shift+alt+click) to remove...

       
  • Marc Delisle

    Marc Delisle - 2014-12-15
    • assigned_to: Marc Delisle
     
  • Marc Delisle

    Marc Delisle - 2014-12-15

    About the second choice, is the alt key meaningful for Mac users? Reading your previous remark, I was under the impression that "option" was the name of this key.

     
    • Isaac Bennetch

      Isaac Bennetch - 2014-12-15

      Well, technically it has both words on it, but I agree with you that 'option' is a better choice if using the second choice.

       
  • Marc Delisle

    Marc Delisle - 2014-12-15

    How about this?
    Ctrl+Click or Alt+Click (Mac: Shift+Option+Click) to remove column from ORDER BY clause

     
    • Isaac Bennetch

      Isaac Bennetch - 2014-12-15

      Yes, I agree with this proposal.

       
  • Marc Delisle

    Marc Delisle - 2014-12-15

    Mac users who know how to produce Alt will understand when reading Alt+Click, and those who don't will understand later when reading Shift+Option+Click.

     
  • Marc Delisle

    Marc Delisle - 2014-12-15
    • summary: Cannot remove table ordering on a Mac --> (ok 4.3.3) Cannot remove table ordering on a Mac
    • status: open --> resolved
    • Group: Latest_Git --> 4.3.2
    • Priority: 5 --> 1
     
  • Marc Delisle

    Marc Delisle - 2014-12-21
    • Status: resolved --> fixed