Skip to content

Commit 0e90130

Browse files
committed
Revert "Focus editor after calling fill_in_rich_text_area"
Closes [rails#46803][]. This reverts commit 67a4ac6. Once the system test helper test suite executes in CI, we can re-introduce the changes as part of [rails#46807][]. [rails#46803]: rails#46803 (comment) [rails#46807]: rails#46807
1 parent a790203 commit 0e90130

File tree

3 files changed

+1
-17
lines changed

3 files changed

+1
-17
lines changed

actiontext/CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88

99
*Jonathan Hefner*
1010

11-
* Focus rich-text editor after calling `fill_in_rich_text_area`
12-
13-
*Sean Doyle*
14-
1511
* Support `strict_loading:` option for `has_rich_text` declaration
1612

1713
*Sean Doyle*

actiontext/lib/action_text/system_test_helper.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ module SystemTestHelper
3030
# # <trix-editor input="trix_input_1"></trix-editor>
3131
# fill_in_rich_text_area "message[content]", with: "Hello <em>world!</em>"
3232
def fill_in_rich_text_area(locator = nil, with:)
33-
javascript = <<~JS
34-
this.editor.loadHTML(arguments[0])
35-
this.editor.focus()
36-
JS
37-
find(:rich_text_area, locator).execute_script(javascript, with.to_s)
33+
find(:rich_text_area, locator).execute_script("this.editor.loadHTML(arguments[0])", with.to_s)
3834
end
3935
end
4036
end

actiontext/test/system/system_test_helper_test.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
require "application_system_test_case"
44

55
class ActionText::SystemTestHelperTest < ApplicationSystemTestCase
6-
test "filling in a rich-text area focuses the trix-editor" do
7-
visit new_message_url
8-
9-
fill_in_rich_text_area "message_content", with: "Hello world!"
10-
11-
assert_selector(:rich_text_area, "message[content]", &:focused?)
12-
end
13-
146
test "filling in a rich-text area by ID" do
157
visit new_message_url
168
assert_selector "trix-editor#message_content"

0 commit comments

Comments
 (0)