Skip to content

Commit 754439d

Browse files
fix #8272: bug in onSpaceKey with shift selection in PickList (#8273)
* fix: bug in onSpaceKey with shift selection in PickList Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> * fix: bug in onSpaceKey with shift selection in PickList Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> * fix: bug in onSpaceKey with shift selection in PickList Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com> --------- Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
1 parent d1843e1 commit 754439d

10 files changed

Lines changed: 12 additions & 48 deletions

File tree

components/lib/picklist/PickList.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,12 +434,12 @@ export const PickList = React.memo(
434434
const focusedItem = DomHandler.findSingle(listElement, `[data-pc-section="item"][id=${focusedOptionIndex}]`);
435435
const matchedOptionIndex = [...items].findIndex((item) => item === focusedItem);
436436

437-
selection = [...listItems].slice(Math.min(selectedItemIndex, matchedOptionIndex), Math.max(selectedItemIndex, matchedOptionIndex) + 1);
437+
const rangeSelection = [...listItems].slice(Math.min(selectedItemIndex, matchedOptionIndex), Math.max(selectedItemIndex, matchedOptionIndex) + 1);
438438

439439
if (isSource) {
440-
onSelectionChange({ originalEvent: event, value: selection }, 'sourceSelection', props.onSourceSelectionChange);
440+
onSelectionChange({ originalEvent: event, value: rangeSelection }, 'sourceSelection', props.onSourceSelectionChange);
441441
} else {
442-
onSelectionChange({ originalEvent: event, value: selection }, 'targetSelection', props.onTargetSelectionChange);
442+
onSelectionChange({ originalEvent: event, value: rangeSelection }, 'targetSelection', props.onTargetSelectionChange);
443443
}
444444
} else {
445445
onEnterKey(event, type);

pages/templates/apollo/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ const animationFeaturesData1 = [
5555
{
5656
id: 2,
5757
title: 'PrimeBlocks',
58-
description: (
59-
<>
60-
Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.
61-
</>
62-
),
58+
description: <>Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.</>,
6359
src: 'https://primefaces.org/cdn/primereact/images/templates/apollo/features-animation-blocks.png'
6460
},
6561
{

pages/templates/atlantis/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ const animationFeaturesData1 = [
5454
{
5555
id: 2,
5656
title: 'PrimeBlocks',
57-
description: (
58-
<>
59-
Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.
60-
</>
61-
),
57+
description: <>Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.</>,
6258
src: 'https://primefaces.org/cdn/primereact/images/templates/apollo/features-animation-blocks.png'
6359
},
6460
{

pages/templates/avalon/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ const animationFeaturesData1 = [
5454
{
5555
id: 2,
5656
title: 'PrimeBlocks',
57-
description: (
58-
<>
59-
Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.
60-
</>
61-
),
57+
description: <>Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.</>,
6258
src: 'https://primefaces.org/cdn/primereact/images/templates/apollo/features-animation-blocks.png'
6359
},
6460
{

pages/templates/diamond/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ const animationFeaturesData1 = [
5454
{
5555
id: 2,
5656
title: 'PrimeBlocks',
57-
description: (
58-
<>
59-
Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.
60-
</>
61-
),
57+
description: <>Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.</>,
6258
src: 'https://primefaces.org/cdn/primereact/images/templates/apollo/features-animation-blocks.png'
6359
},
6460
{

pages/templates/freya/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ const animationFeaturesData1 = [
5454
{
5555
id: 2,
5656
title: 'PrimeBlocks',
57-
description: (
58-
<>
59-
Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.
60-
</>
61-
),
57+
description: <>Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.</>,
6258
src: 'https://primefaces.org/cdn/primereact/images/templates/apollo/features-animation-blocks.png'
6359
},
6460
{

pages/templates/genesis/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,7 @@ const animationFeaturesData1 = [
6565
{
6666
id: 2,
6767
title: 'PrimeBlocks',
68-
description: (
69-
<>
70-
Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.
71-
</>
72-
),
68+
description: <>Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.</>,
7369
src: 'https://primefaces.org/cdn/primereact/images/templates/apollo/features-animation-blocks.png'
7470
},
7571
{

pages/templates/sakai/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,7 @@ const animationFeaturesData1 = [
4040
{
4141
id: 2,
4242
title: 'PrimeBlocks',
43-
description: (
44-
<>
45-
Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.
46-
</>
47-
),
43+
description: <>Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.</>,
4844
src: 'https://primefaces.org/cdn/primereact/images/templates/babylon/features-animation-blocks.png'
4945
},
5046
{

pages/templates/ultima/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ const animationFeaturesData1 = [
5454
{
5555
id: 2,
5656
title: 'PrimeBlocks',
57-
description: (
58-
<>
59-
Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.
60-
</>
61-
),
57+
description: <>Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.</>,
6258
src: 'https://primefaces.org/cdn/primereact/images/templates/apollo/features-animation-blocks.png'
6359
},
6460
{

pages/templates/verona/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,7 @@ const animationFeaturesData1 = [
5454
{
5555
id: 2,
5656
title: 'PrimeBlocks',
57-
description: (
58-
<>
59-
Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.
60-
</>
61-
),
57+
description: <>Designed to be fully compatible with upcoming next-gen PrimeBlocks, choose from the extensive range of blocks and customize the way you like.</>,
6258
src: 'https://primefaces.org/cdn/primereact/images/templates/apollo/features-animation-blocks.png'
6359
},
6460
{

0 commit comments

Comments
 (0)