ScrollEvent
Scroll position and sizes, in points.
Verwendung
Scroll a list in a test.
Dieser Typ wird verwendet von List
// Scroll a list in a test.
import { List, Text } from 'kuito';
import { assert, render, screen, scroll, test } from 'kuito/tests';
const rows = Array.from({ length: 200 }, (_, index) => `Row ${index}`);
const Long = () => <List data={rows} renderItem={({ item }) => <Text height={44}>{item}</Text>} />;
test('rows far down bind once the list scrolls to them', async () => {
await render(<Long />);
assert.equal(screen.queryByText('Row 150'), null);
await scroll(screen.getByText('Row 0'), { y: 150 * 44 });
assert.ok(screen.getByText('Row 150'));
});Typdeklaration
export interface ScrollEvent extends KuitoEvent<'scroll'>, ScrollPayload {}Mitglieder 9
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
type | "scroll" | Ja | — |
target | unknown | Ja | — |
isTrusted | boolean | Ja | — |
x | number | Ja | — |
y | number | Ja | — |
contentWidth | number | Ja | — |
contentHeight | number | Ja | — |
layoutWidth | number | Ja | — |
layoutHeight | number | Ja | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.