Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6184: Handle null originalEvent in Jest tests #6206

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1728,10 +1728,10 @@ export const Calendar = React.memo(
originalEvent: event,
value: newValue,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
4 changes: 2 additions & 2 deletions components/lib/checkbox/Checkbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ export const Checkbox = React.memo(
value: props.value,
checked: value,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
type: 'checkbox',
Expand Down
8 changes: 4 additions & 4 deletions components/lib/chips/Chips.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ export const Chips = React.memo(
originalEvent: event,
value: values,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down Expand Up @@ -200,10 +200,10 @@ export const Chips = React.memo(
originalEvent: event,
value: items,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
4 changes: 2 additions & 2 deletions components/lib/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,10 @@ export const Dropdown = React.memo(
originalEvent: event,
value: undefined,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
4 changes: 2 additions & 2 deletions components/lib/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -981,10 +981,10 @@ export const InputNumber = React.memo(
originalEvent: event,
value: value,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
4 changes: 2 additions & 2 deletions components/lib/inputswitch/InputSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ export const InputSwitch = React.memo(
originalEvent: event,
value,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
8 changes: 4 additions & 4 deletions components/lib/listbox/ListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ export const ListBox = React.memo(
originalEvent: event,
value,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down Expand Up @@ -509,10 +509,10 @@ export const ListBox = React.memo(
originalEvent: event,
value,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
4 changes: 2 additions & 2 deletions components/lib/multiselect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,10 @@ export const MultiSelect = React.memo(
value,
selectedOption,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
4 changes: 2 additions & 2 deletions components/lib/multistatecheckbox/MultiStateCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ export const MultiStateCheckbox = React.memo(
originalEvent: event,
value: newValue,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
4 changes: 2 additions & 2 deletions components/lib/radiobutton/RadioButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export const RadioButton = React.memo(
value: props.value,
checked: value,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
type: 'radio',
Expand Down
8 changes: 4 additions & 4 deletions components/lib/rating/Rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export const Rating = React.memo(
originalEvent: event,
value: i,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand All @@ -67,10 +67,10 @@ export const Rating = React.memo(
originalEvent: event,
value: null,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
4 changes: 2 additions & 2 deletions components/lib/treeselect/TreeSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ export const TreeSelect = React.memo(
originalEvent: event,
value: undefined,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
4 changes: 2 additions & 2 deletions components/lib/tristatecheckbox/TriStateCheckbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ export const TriStateCheckbox = React.memo(
originalEvent: event,
value: newValue,
stopPropagation: () => {
event.stopPropagation();
event?.stopPropagation();
},
preventDefault: () => {
event.preventDefault();
event?.preventDefault();
},
target: {
name: props.name,
Expand Down
Loading