mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
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:
committed by
GitHub
parent
3e74985203
commit
4a556dda8b
@@ -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 */
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user