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

Fix absolute positioned mentions #7

Open
wants to merge 1 commit into
base: hotwire-example-action-text-mentions
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ with the [link_to][] helper:

Since the mentions are entirely String-based, they won't include any
information related to a `User` record's identifier. We'll need to add
support for resolveing records based on the `params[:id]` path
support for resolving records based on the `params[:id]` path
parameter.

The generated `UsersController#set_user` helper method queries rows by
Expand Down Expand Up @@ -930,7 +930,6 @@ or on <kbd>escape</kbd>:
+ action: "
+ keydown->mentions#collapseOnEscape
+ keydown->mentions#collapseOnCursorExit
+ trix-blur->mentions#collapse
+ " } %>

<button form="new_mention" name="username" data-mentions-target="submit" hidden>Search</button>
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class User < ApplicationRecord
include ActionText::Attachable

scope :username_matching_handle, ->(handle) { where <<~SQL, handle.delete_prefix("@") + "%" }
username LIKE ?
username ILIKE ?
SQL

def to_trix_content_attachment_partial_path
Expand Down
1 change: 0 additions & 1 deletion app/views/messages/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
action: "
keydown->mentions#collapseOnEscape
keydown->mentions#collapseOnCursorExit
trix-blur->mentions#collapse
" } %>

<button form="new_mention" name="username" data-mentions-target="submit" hidden>Search</button>
Expand Down