Repository navigation
Host MAC tab: show the primary MAC as selected - #2105
Merged
Merged
Conversation
The primary radios shared name="primary". DataTables Responsive measures the grid by inserting a copy of it into the page. The copy's checked radio joined the same named group and unchecked the real one, then the copy was removed. Every host's MAC tab showed no primary MAC, and a new choice looked lost after the redraw (forums 18310). The saved flag was correct. The radio now has no name, so a copy cannot touch it, and the change handler clears the other radios itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Forums 18310: on every host's MAC Addresses tab, no MAC shows as primary. A newly chosen primary also looks lost after the redraw. The database is correct: the poster has 1295 primary MACs, and the grid's JSON returns
primary: 1.Cause
The primary radios shared
name="primary". DataTables Responsive measures the grid by inserting a copy of the table into the page. The copied radio is checked and joins the same named group, so the browser unchecks the real radio. Then the copy is removed. Observed on the lab in a browser: the real radio kept itscheckedattribute, but itscheckedproperty was false. A MutationObserver showed the copy (dtr-inline collapsed) added and removed.Change
nameattribute, so a copy cannot uncheck it.onMacsRadioSelect()clears the other primary radios itself, so one stays selected.updateprimary=1&primary=<id>) and the redraw are unchanged.Side effect: arrow keys no longer move between these radios. Tab reaches each one.
Tests
tests/mac-primary-radio-survives-responsive.test.phppins both parts by source. It fails 2 of 3 on the dev-branch file.updateprimary=1&primary=670. That POST was intercepted, so lab data did not change.🤖 Generated with Claude Code