You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On 1.3.1, this worked as expected; the text area was filled and then selection was moved to the end. On 2.0.7, the setSelectedRange call doesn't work; the selection stays at [0,0].
I haven't been able to find the root cause, and haven't found a way to get setSelectedRange working, but replacing fill_in_rich_text_area with Capybara's set method works around the issue:
I'm curious if there's a known change to loadHTML (called by fill_in_rich_text_area) or setSelectedRange in 2.x that might have caused this behavior, but I understand this isn't necessarily a Trix bug, so feel free to close this as you see fit. I mainly wanted to note the issue and workaround for anyone else who might encounter it.
Details
Trix version: 2.0.7
Browser name and version: Chrome 119.0.6045.159 (via system test)
Operating system: macOS 14.1
The text was updated successfully, but these errors were encountered:
Our team is updating our Rails 7.0.8 app to Trix 2.0.7 from 1.3.1, which introduced a failure in one of our system tests that calls
setSelectedRange
:On 1.3.1, this worked as expected; the text area was filled and then selection was moved to the end. On 2.0.7, the
setSelectedRange
call doesn't work; the selection stays at [0,0].I haven't been able to find the root cause, and haven't found a way to get
setSelectedRange
working, but replacingfill_in_rich_text_area
with Capybara'sset
method works around the issue:I'm curious if there's a known change to
loadHTML
(called byfill_in_rich_text_area
) orsetSelectedRange
in 2.x that might have caused this behavior, but I understand this isn't necessarily a Trix bug, so feel free to close this as you see fit. I mainly wanted to note the issue and workaround for anyone else who might encounter it.Details
The text was updated successfully, but these errors were encountered: