diff --git a/components/lib/splitter/Splitter.js b/components/lib/splitter/Splitter.js index 1a8e091aa3..6cddd15d13 100644 --- a/components/lib/splitter/Splitter.js +++ b/components/lib/splitter/Splitter.js @@ -253,24 +253,24 @@ export const Splitter = React.memo( } case 'Home': { - resizePanel(index, 100, minSize); + resizePanel(index, 100 - minSize, minSize); event.preventDefault(); break; } case 'End': { - resizePanel(index, minSize, 100); + resizePanel(index, minSize, 100 - minSize); event.preventDefault(); break; } case 'Enter': { - if (prevSize.current > 100 - (minSize || 5)) { - resizePanel(index, minSize, 100); + if (prevSize.current >= 100 - (minSize || 5)) { + resizePanel(index, minSize, 100 - minSize); } else { - resizePanel(index, 100, minSize); + resizePanel(index, 100 - minSize, minSize); } event.preventDefault(); @@ -386,8 +386,7 @@ export const Splitter = React.memo( onTouchStart: (event) => onGutterTouchStart(event, index), onTouchMove: (event) => onGutterTouchMove(event), onTouchEnd: (event) => onGutterTouchEnd(event), - 'data-p-splitter-gutter-resizing': false, - role: 'separator' + 'data-p-splitter-gutter-resizing': false }, ptm('gutter') ); @@ -396,6 +395,7 @@ export const Splitter = React.memo( { tabIndex: getPanelProp(panel, 'tabIndex') || 0, className: cx('gutterHandler'), + role: 'separator', 'aria-orientation': horizontal ? 'vertical' : 'horizontal', 'aria-controls': panelId, 'aria-label': getPanelProp(panel, 'aria-label'), diff --git a/components/lib/splitter/__snapshots__/Splitter.spec.js.snap b/components/lib/splitter/__snapshots__/Splitter.spec.js.snap index ba089e7797..2dd53bf996 100644 --- a/components/lib/splitter/__snapshots__/Splitter.spec.js.snap +++ b/components/lib/splitter/__snapshots__/Splitter.spec.js.snap @@ -23,7 +23,6 @@ exports[`Splitter Nested 1`] = ` class="p-splitter-gutter" data-p-splitter-gutter-resizing="false" data-pc-section="gutter" - role="separator" style="width: 4px;" >
@@ -66,7 +66,6 @@ exports[`Splitter Nested 1`] = ` class="p-splitter-gutter" data-p-splitter-gutter-resizing="false" data-pc-section="gutter" - role="separator" style="height: 4px;" > @@ -109,7 +109,6 @@ exports[`Splitter Nested 1`] = ` class="p-splitter-gutter" data-p-splitter-gutter-resizing="false" data-pc-section="gutter" - role="separator" style="width: 4px;" > @@ -165,7 +165,6 @@ exports[`Splitter Single Panel with size 1`] = ` class="p-splitter-gutter" data-p-splitter-gutter-resizing="false" data-pc-section="gutter" - role="separator" style="height: 4px;" > @@ -207,7 +207,6 @@ exports[`Splitter Single Panel without size 1`] = ` class="p-splitter-gutter" data-p-splitter-gutter-resizing="false" data-pc-section="gutter" - role="separator" style="height: 4px;" > @@ -249,7 +249,6 @@ exports[`Splitter Splitter requires two SplitterPanel components to wrap. 1`] = class="p-splitter-gutter" data-p-splitter-gutter-resizing="false" data-pc-section="gutter" - role="separator" style="width: 4px;" > @@ -301,7 +301,6 @@ exports[`Splitter Vertical layout 1`] = ` class="p-splitter-gutter" data-p-splitter-gutter-resizing="false" data-pc-section="gutter" - role="separator" style="height: 4px;" > diff --git a/components/lib/splitter/splitter.d.ts b/components/lib/splitter/splitter.d.ts index d69f2f45db..1c9b0e8a19 100644 --- a/components/lib/splitter/splitter.d.ts +++ b/components/lib/splitter/splitter.d.ts @@ -139,11 +139,6 @@ interface SplitterPanelProps extends Omit