diff --git a/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.razor.js b/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.razor.js index 964cc685568..13d7cfa3603 100644 --- a/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.razor.js +++ b/src/BootstrapBlazor/Components/DateTimePicker/DateTimePicker.razor.js @@ -13,7 +13,9 @@ export function init(id, invoke, options) { return el.classList.contains('disabled'); }, hideCallback: () => { - invoke?.invokeMethodAsync(options.triggerHideCallback); + if (invoke) { + invoke.invokeMethodAsync(options.triggerHideCallback); + } } }); const dateTimePicker = { diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.js b/src/BootstrapBlazor/Components/Table/Table.razor.js index 7a2d55c18b3..6be8c44c291 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.js +++ b/src/BootstrapBlazor/Components/Table/Table.razor.js @@ -425,18 +425,22 @@ const setExcelKeyboardListener = table => { } } else if (keyCode === KeyCodes.UP_ARROW) { - cells = tr.previousElementSibling?.children; - while (index < cells.length) { - if (activeCell(cells, index)) { - break; + cells = tr.previousElementSibling && tr.previousElementSibling.children; + if (cells) { + while (index < cells.length) { + if (activeCell(cells, index)) { + break; + } } } } else if (keyCode === KeyCodes.DOWN_ARROW) { - cells = tr.nextElementSibling?.children; - while (index < cells.length) { - if (activeCell(cells, index)) { - break; + cells = tr.nextElementSibling && tr.nextElementSibling.children; + if (cells) { + while (index < cells.length) { + if (activeCell(cells, index)) { + break; + } } } } diff --git a/src/BootstrapBlazor/Components/Typed/Typed.razor.js b/src/BootstrapBlazor/Components/Typed/Typed.razor.js index 77bdab9eb44..fef645143f6 100644 --- a/src/BootstrapBlazor/Components/Typed/Typed.razor.js +++ b/src/BootstrapBlazor/Components/Typed/Typed.razor.js @@ -2,7 +2,7 @@ import Typed from '../../lib/typedjs/typed.module.js' const getOptions = (text, invoke, options, callbacks) => { - options ??= {}; + options ||= {}; if (text) { options.strings = [text]; diff --git a/src/BootstrapBlazor/wwwroot/modules/fullscreen.js b/src/BootstrapBlazor/wwwroot/modules/fullscreen.js index 695f772ae85..d7bb0f555a1 100644 --- a/src/BootstrapBlazor/wwwroot/modules/fullscreen.js +++ b/src/BootstrapBlazor/wwwroot/modules/fullscreen.js @@ -2,10 +2,11 @@ export async function toggle(options) { let el = null; - if (options?.id) { + options ||= {}; + if (options.id) { el = document.getElementById(options.id); } - else if (options?.element && isElement(options.element)) { + else if (isElement(options.element)) { el = options.element; } else { diff --git a/src/BootstrapBlazor/wwwroot/modules/utility.js b/src/BootstrapBlazor/wwwroot/modules/utility.js index f9da376607f..f0fe3e1cf5f 100644 --- a/src/BootstrapBlazor/wwwroot/modules/utility.js +++ b/src/BootstrapBlazor/wwwroot/modules/utility.js @@ -809,8 +809,8 @@ const deepMerge = (obj1, obj2, skipNull = true) => { } export function registerBootstrapBlazorModule(name, identifier, callback) { - window.BootstrapBlazor ??= {}; - window.BootstrapBlazor[name] ??= { + window.BootstrapBlazor ||= {}; + window.BootstrapBlazor[name] ||= { _init: false, _items: [], register: function (id, cb) {