Skip to content

Fix autosuggest mouse selection and removal of accepted items (#9363) - #9908

Open
boredskull wants to merge 1 commit into
SimpleMachines:release-3.0from
boredskull:fix-9363-autosuggest-mouse-interaction
Open

boredskull wants to merge 1 commit into
SimpleMachines:release-3.0from
boredskull:fix-9363-autosuggest-mouse-interaction

Conversation

@boredskull

Copy link
Copy Markdown

Summary

This PR addresses two issues with the autosuggest functionality in SMF 3.0, affecting areas such as private message recipients and board moderator assignments.

Issues identified

1. Unable to select suggestions using the mouse

When typing a member's name, the autosuggest dropdown appears correctly. However, clicking a suggestion does not select it.

The input field's onblur event immediately calls autoSuggestActualHide(), hiding the suggestions before the mouse click can be processed.

2. Unable to remove previously selected members

Clicking the red remove icon beside an accepted member does nothing.

The delete event passes the full DOM element ID to deleteAddedItem(). However, that function already constructs the element ID using the suggest_ prefix, resulting in an incorrect lookup.

Changes made

  • Replaced the immediate blur handler with the existing autoSuggestHide() function, allowing a short delay before the dropdown closes.
  • Corrected the remove-item event handler to pass the original item ID rather than the prefixed DOM element ID.
  • Preserved the existing keyboard navigation and autosuggest functionality.
  • Limited changes to Themes/default/scripts/suggest.js, without modifying PHP files or templates.

Testing

Completed:

  • Reviewed both affected functions and their event handlers.
  • Verified the corrected function references.
  • Confirmed that only one JavaScript file was modified.
  • Confirmed the changes are limited to four additions and two deletions.

Still requiring testing:

  • Mouse selection of suggested members.
  • Removing selected members using the red X.
  • Keyboard navigation using Tab and Enter.
  • Private message recipient selection.
  • Board moderator assignment.
  • Behaviour across supported browsers.

Full browser-based integration testing has not yet been performed.

Issues References (Fixes|Related|Closes)

Related #9363

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant