@@ -91,7 +91,7 @@ class ResponsiveGrid extends BasePlugin {
9191 * @param {import("../data-grid.js").Column[] } columns
9292 */
9393 extendColumns ( columns ) {
94- if ( ! this . grid . options . responsive || ! this . grid . options . responsiveToggle ) {
94+ if ( ! this . grid . options . responsive || ! this . grid . options . responsiveToggle || this . _sharesDisclosure ( ) ) {
9595 return ;
9696 }
9797 columns . unshift ( {
@@ -271,7 +271,11 @@ class ResponsiveGrid extends BasePlugin {
271271 } , 0 ) ;
272272 const requiredWidth = ( /** @type {Array<any> } */ visibleItems ) => {
273273 let total = fixedWidth ;
274- if ( grid . options . responsiveToggle && items . some ( ( { column } ) => column ?. responsiveHidden ) ) {
274+ if (
275+ grid . options . responsiveToggle &&
276+ ! this . _sharesDisclosure ( ) &&
277+ items . some ( ( { column } ) => column ?. responsiveHidden )
278+ ) {
275279 total += RESPONSIVE_TOGGLE_WIDTH ;
276280 }
277281 for ( const { th } of visibleItems ) {
@@ -429,6 +433,44 @@ class ResponsiveGrid extends BasePlugin {
429433 }
430434 }
431435
436+ /**
437+ * True when the row details column already provides a disclosure control
438+ * for every row: responsive then yields, rather than rendering a second
439+ * identical chevron next to it, and follows that control instead.
440+ *
441+ * Both facts are required: the option carries the intent, the plugin does
442+ * the rendering. If either is missing (ex: a non standard registration
443+ * name), responsive keeps its own toggle — the safe fallback is a visible
444+ * control, never hidden values with no way to reach them.
445+ * @returns {Boolean }
446+ */
447+ _sharesDisclosure ( ) {
448+ return (
449+ Boolean ( this . grid . options . responsiveToggle ) &&
450+ typeof this . grid . options . rowDetails === "function" &&
451+ Boolean ( this . grid . getPlugin ( "RowDetails" ) )
452+ ) ;
453+ }
454+
455+ /**
456+ * Follow the shared disclosure control: the row details toggle governs the
457+ * whole expansion surface of its row, responsive values included. No-op
458+ * unless responsive has yielded its own toggle, so an explicit
459+ * `responsiveToggle: false` keeps its section governed by
460+ * `responsiveStartOpen` alone.
461+ * @public
462+ * @param {HTMLTableRowElement } tr
463+ * @param {Boolean } expanded
464+ */
465+ followDisclosure ( tr , expanded ) {
466+ if ( ! this . _sharesDisclosure ( ) ) {
467+ return ;
468+ }
469+ this . blockObserver ( ) ;
470+ this . _setRowExpanded ( tr , expanded ) ;
471+ this . unblockObserver ( ) ;
472+ }
473+
432474 /**
433475 * Reflect the expanded state on the toggle column icon (no-op when there is
434476 * no toggle column, i.e. `responsiveToggle: false`).
0 commit comments