Page size dropdown on /review page does nothing #78
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The per-page dropdown at the bottom of the /review LiveView page has no effect when changed. Selecting a different value does not reload the page with the new number of posts.
Cause
The element in ReviewLiveView._render_table_footer() (liveviews.py line 1400) lacks a name attribute. Without name="value", the browser does not include the select value in the form data sent with the phx-change event. The handler handle_set_page_size reads payload.get("value", 20), which always falls back to the default 20.
Fix
Add name="value" to the
element.The fix is a single attribute addition in liveviews.py line 1400: add
name="value"to the<select>element in_render_table_footer().Plan
fix/issue-78-page-size-dropdownname="value"to the selectmainRoot cause found — the previous fixes were all server-side, but the event never reaches the server.
The page-size select had phx-change="set_page_size" but no ancestor
. In the LiveView JS (app.js pushInput), a change on an input with its own phx-change calls serializeForm(inputEl.form, ...) → new FormData(null), which throws a TypeError in the browser. The push is aborted before any websocket frame is sent, so handle_set_page_size never ran: no re-render, and page_size stayed 20 for next_page navigation.Fix: wrap the select in (commit
34c9619), matching how the working filter form operates. The server-side handler from the previous commits (name="value", parse_qs list handling) is correct and now actually gets exercised. Added a render test asserting the select is inside the form.