WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#32580 closed defect (bug) (fixed)

Quick edit: persisting auto-suggest tags tooltip

Reported by: afercia Owned by: afercia
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.2
Component: Quick/Bulk Edit Keywords: has-patch commit has-screenshots
Focuses: ui, javascript Cc:

Description

Please refer to the screenshot below. To reproduce:

  • quick edit a post which has at least one tag
  • using your keyboard, tab through the form elements and focus the Tags textarea
  • press tab again
  • the jQuery suggest tooltip will appear
  • keep tabbing, the tooltip it's still there
  • even when you press "Cancel" or "Update" and the quick edit form closes, the tooltip is still there, overlaying the Posts list

https://cldup.com/Pwo86-o7qp.png

Attachments (5)

32580.diff (576 bytes) - added by rommelxcastro 5 years ago.
32580.1.diff (12.8 KB) - added by rommelxcastro 5 years ago.
reuse of selectors, trying to improve performance
32580.2.diff (1.1 KB) - added by afercia 5 years ago.
32580.3.diff (1.1 KB) - added by afercia 5 years ago.
32580.4.diff (1.1 KB) - added by afercia 5 years ago.

Download all attachments as: .zip

Change History (22)

#1 follow-up: @rommelxcastro
5 years ago

  • Keywords has-patch added; needs-patch removed

Hi guys here's a patch, i didn't find a better way to deal with this, the plugin doesn't have a public function to accomplish this.

@rommelxcastro
5 years ago

@rommelxcastro
5 years ago

reuse of selectors, trying to improve performance

#2 in reply to: ↑ 1 ; follow-up: @afercia
5 years ago

Replying to rommelxcastro:

didn't find a better way to deal with this, the plugin doesn't have a public function to accomplish this.

Hi @rommelxcastro, thanks very much. Had a look at the plugin and yes maybe the more appropriate fix would be patching the plugin (which was already patched in the past as far as I see). Maybe we should ask some devs, maybe @azaozz? :)

Worth noting there are also a couple more things that don't work properly.

Initially, prevLength is always 0 so it assumes to find an empty form field. When there is already a tag saved $input.val().length != prevLength will always be true and it will trigger the suggest when you blur the field, also when you don't do any change. Thinking prevLength should be a plugin option to be set to the current field value length.

The blur interval here:

$input.blur(function() {
	setTimeout(function() { $results.hide() }, 200);
});

should be configurable via plugin options, as the delay interval (currently set to 500) is. Please notice that currently the hide interval triggers before the suggest and that's the reason why the tooltip persists.

Pressing Escape when in the textarea should close the suggest tooltip. To fix this, we should return in a couple of places in inline-edit-post.js if the event target is the textarea.

#3 @iseulde
5 years ago

  • Component changed from Administration to Quick/Bulk Edit

This ticket was mentioned in Slack in #core-editor by afercia. View the logs.


5 years ago

#5 in reply to: ↑ 2 @rommelxcastro
5 years ago

Replying to afercia:

Replying to rommelxcastro:

didn't find a better way to deal with this, the plugin doesn't have a public function to accomplish this.

Hi @rommelxcastro, thanks very much. Had a look at the plugin and yes maybe the more appropriate fix would be patching the plugin (which was already patched in the past as far as I see). Maybe we should ask some devs, maybe @azaozz? :)

if there is no problem on changing the plugin code, i'm more than glad to help with that! just give me a green light :)

#6 @afercia
5 years ago

See also #33019 for a new way to trigger this bug.

#7 @afercia
5 years ago

#33019 was marked as a duplicate.

@afercia
5 years ago

#8 @afercia
5 years ago

Refreshed @rommelxcastro patch to hide the suggest results also when saving.

#9 @afercia
5 years ago

Please notice that when adding tags on several posts using Quick Edit or when quick-editing again a previously quick-edited post to add new tags makes a "suggest" div being appended to the body each time. This happens also before the proposed patch. With the patch applied at least they're hidden :)

https://cldup.com/wM2TqjRw7b.png

This ticket was mentioned in Slack in #core by afercia. View the logs.


5 years ago

@afercia
5 years ago

#11 @afercia
5 years ago

Refreshed patch removes tag names from jQuery selectors as per @obenland suggestion

#12 @afercia
5 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 4.4

Patch still applies and fixes the main issue. There are outstanding issues with jquery.suggest that should (maybe) be handled in separate tickets. Would recommend for commit consideration.

This ticket was mentioned in Slack in #core by afercia. View the logs.


5 years ago

#14 @wonderboymusic
5 years ago

  • Owner set to afercia
  • Status changed from new to assigned

@afercia
5 years ago

#15 @afercia
5 years ago

Refreshed patch to always use a $varName format with a leading $ for jQuery objects.

#16 @afercia
5 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 34064:

Quick Edit: fix the Tags auto-suggest tooltip visibility.

Be sure to hide the jquery.suggest Tags textarea tooltip also when using the keyboard to Save/Cancel.

Props rommelxcastro for the initial patch.
Fixes #32580.

#17 @ryan
5 years ago

  • Keywords has-screenshots added
Note: See TracTickets for help on using tickets.