Skip to content

Commit 54f333f

Browse files
committed
Added disable_animation_extra_properties option so that I can also add caret-color: transparent; to the disable animations CSS
1 parent f829e43 commit 54f333f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/capybara/server/animation_disabler.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ def self.selector_for(css_or_bool)
1616

1717
def initialize(app)
1818
@app = app
19-
@disable_markup = format(DISABLE_MARKUP_TEMPLATE, selector: self.class.selector_for(Capybara.disable_animation))
19+
@disable_markup = format(DISABLE_MARKUP_TEMPLATE,
20+
selector: self.class.selector_for(Capybara.disable_animation),
21+
extra_properties: Capybara.disable_animation_extra_properties
22+
)
2023
end
2124

2225
def call(env)
@@ -51,6 +54,7 @@ def insert_disable(html)
5154
animation-duration: 0s !important;
5255
animation-delay: 0s !important;
5356
scroll-behavior: auto !important;
57+
%<extra_properties>s
5458
}
5559
</style>
5660
HTML

lib/capybara/session/config.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ class SessionConfig
77
OPTIONS = %i[always_include_port run_server default_selector default_max_wait_time ignore_hidden_elements
88
automatic_reload match exact exact_text raise_server_errors visible_text_only
99
automatic_label_click enable_aria_label save_path asset_host default_host app_host
10-
server_host server_port server_errors default_set_options disable_animation test_id
11-
predicates_wait default_normalize_ws w3c_click_offset enable_aria_role].freeze
10+
server_host server_port server_errors default_set_options disable_animation
11+
disable_animation_extra_properties test_id predicates_wait default_normalize_ws
12+
w3c_click_offset enable_aria_role].freeze
1213

1314
attr_accessor(*OPTIONS)
1415

0 commit comments

Comments
 (0)