Skip to content
Open
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
18 changes: 12 additions & 6 deletions lib/capybara/selenium/nodes/chrome_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,18 @@ def send_keys(*args)
.each do |contains_emoji, inputs|
if contains_emoji
inputs.join.grapheme_clusters.chunk { |gc| gc.match?(/\p{Emoji Presentation}/) }
.each do |emoji, clusters|
if emoji
driver.send(:execute_cdp, 'Input.insertText', text: clusters.join)
else
super(clusters.join)
end
.each do |_emoji, clusters|
# For non-headless we can send non-emoji normally and then send emoji via CDP
# thereby getting key events and emoji. Unfortunately that doesn't work for
# headless chrome currently so just send via cdp
driver.send(:execute_cdp, 'Input.insertText', text: clusters.join)

# .each do |emoji, clusters|
# if emoji
# driver.send(:execute_cdp, 'Input.insertText', text: clusters.join)
# else
# super(clusters.join)
# end
end
else
super(*inputs)
Expand Down