Skip to content

Bugfix: nested within was resetting to top-level#317

Open
markevans wants to merge 1 commit into
germsvel:mainfrom
markevans:main
Open

Bugfix: nested within was resetting to top-level#317
markevans wants to merge 1 commit into
germsvel:mainfrom
markevans:main

Conversation

@markevans

@markevans markevans commented May 21, 2026

Copy link
Copy Markdown

Hi - thanks for this useful library.

This is a fix for things like the following:

<div class="page-1">
  <p>...</p>
  <button>Next</button>
</div>

<div class="page-2">
  <button>Next</button>
</div>
conn
|> within(".page-1", fn page ->
  |> within("p", fn p ->
    # assert something...
  end)
  # THIS BREAKS! due to finding multiple buttons because `within` resets scope to :none
  |> click_button("Next")
end)

within was resetting the scope to :none, rather than the parent scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant