Implement sub-iterators for list navigation (#2155)

We recently introduced shortcut-based list navigation that ran into problems when the list contained items that were loaded asynchronously but had stand at the beginning of the list. As the system is based on render order, we had to introduce a new layer in-between the main iterator and the asynchronously loaded items. This new layer is called a "sub-iterator", which functions literally like the main iterator with the exception that it can also be used as an item of a parent-iterator. This allows for more complicated use-cases and the support of keyboard iterators around extension points. This pull request also fixes an unreleased regression where usages of the deprecated confirmAlert function caused a nullpointer exception.
This commit is contained in:
Konstantin Schaper
2022-11-16 11:01:27 +01:00
committed by GitHub
parent 3e74985203
commit 4a556dda8b
8 changed files with 546 additions and 82 deletions

View File

@@ -26,4 +26,15 @@ import React from "react";
export type ModalStateContextType = { value: number; increment: () => void; decrement: () => void };
export default React.createContext<ModalStateContextType>({} as ModalStateContextType);
export default React.createContext<ModalStateContextType>({
value: 0,
increment: () => {
// eslint-disable-next-line no-console
console.warn(
"Modals should be declared inside a ModalStateContext. Did you use the deprecated 'confirmAlert' function over the 'ConfirmAlert' component ?"
);
},
decrement: () => {
/* Do nothing */
},
});