Fix overscroll behavior

This commit is contained in:
IRBorisov 2024-05-02 21:34:47 +03:00
parent 91c5993b10
commit 3024cde1b1
14 changed files with 16 additions and 13 deletions

View File

@ -79,6 +79,7 @@
"NPRO", "NPRO",
"NUMR", "NUMR",
"Opencorpora", "Opencorpora",
"overscroll",
"passwordreset", "passwordreset",
"perfectivity", "perfectivity",
"PNCT", "PNCT",

View File

@ -12,7 +12,7 @@ Styling conventions
- outer layout: fixed bottom-1/2 left-0 -translate-x-1/2 - outer layout: fixed bottom-1/2 left-0 -translate-x-1/2
- rectangle: mt-3 min-w-fit min-w-10 flex-grow shrink-0 - rectangle: mt-3 min-w-fit min-w-10 flex-grow shrink-0
- inner layout: px-3 py-2 flex flex-col gap-3 justify-between items-center - inner layout: px-3 py-2 flex flex-col gap-3 justify-between items-center
- overflow behavior: overflow-scroll - overflow behavior: overflow-scroll overscroll-contain
- border: borer-2 outline-none shadow-md - border: borer-2 outline-none shadow-md
- colors: clr-controls - colors: clr-controls
- text: text-start text-sm font-semibold whitespace-nowrap - text: text-start text-sm font-semibold whitespace-nowrap

View File

@ -23,7 +23,7 @@ function ApplicationLayout() {
<div <div
id={globals.main_scroll} id={globals.main_scroll}
className='overflow-y-auto overscroll-none min-w-fit' className='cc-scroll-y min-w-fit'
style={{ style={{
maxHeight: viewportHeight, maxHeight: viewportHeight,
overflowY: showScroll ? 'scroll' : 'auto' overflowY: showScroll ? 'scroll' : 'auto'

View File

@ -252,7 +252,7 @@ function SubstitutionsPicker({
dense dense
noHeader noHeader
noFooter noFooter
className='w-full overflow-y-auto text-sm border select-none' className='w-full text-sm border select-none cc-scroll-y'
rows={rows} rows={rows}
contentHeight='1.3rem' contentHeight='1.3rem'
data={items} data={items}

View File

@ -84,7 +84,7 @@ function Modal({
{header ? <h1 className='px-12 py-2 select-none'>{header}</h1> : null} {header ? <h1 className='px-12 py-2 select-none'>{header}</h1> : null}
<div <div
className={clsx('overflow-auto', className)} className={clsx('overflow-auto overscroll-contain', className)}
style={{ style={{
maxHeight: 'calc(100vh - 8rem)', maxHeight: 'calc(100vh - 8rem)',
maxWidth: 'calc(100vw - 2rem)' maxWidth: 'calc(100vw - 2rem)'

View File

@ -32,7 +32,7 @@ function Tooltip({
delayShow={1000} delayShow={1000}
delayHide={100} delayHide={100}
opacity={0.97} opacity={0.97}
className={clsx('overflow-auto sm:overflow-hidden', 'border shadow-md', layer, className)} className={clsx('overflow-auto sm:overflow-hidden overscroll-contain', 'border shadow-md', layer, className)}
classNameArrow={layer} classNameArrow={layer}
style={{ ...{ paddingTop: '2px', paddingBottom: '2px' }, ...style }} style={{ ...{ paddingTop: '2px', paddingBottom: '2px' }, ...style }}
variant={darkMode ? 'dark' : 'light'} variant={darkMode ? 'dark' : 'light'}

View File

@ -18,7 +18,7 @@ function ConstituentsList({ list, schema, title, prefix }: ConstituentsListProps
{title}: <b>{list.length}</b> {title}: <b>{list.length}</b>
</p> </p>
) : null} ) : null}
<div className={clsx('h-[9rem]', 'px-3', 'overflow-y-auto', 'border', 'whitespace-nowrap')}> <div className={clsx('h-[9rem]', 'px-3', 'cc-scroll-y', 'border', 'whitespace-nowrap')}>
{list.map(id => { {list.map(id => {
const cst = schema.cstByID.get(id); const cst = schema.cstByID.get(id);
return cst ? <p key={`${prefix}${cst.id}`}>{labelConstituenta(cst)}</p> : null; return cst ? <p key={`${prefix}${cst.id}`}>{labelConstituenta(cst)}</p> : null;

View File

@ -18,7 +18,7 @@ function ParsingResult({ isOpen, data, disabled, onShowError }: ParsingResultPro
return ( return (
<motion.div <motion.div
className='dense border text-sm overflow-y-auto' className='text-sm border dense cc-scroll-y'
initial={false} initial={false}
animate={isOpen ? 'open' : 'closed'} animate={isOpen ? 'open' : 'closed'}
variants={animateParseResults} variants={animateParseResults}

View File

@ -360,7 +360,7 @@ function EditorTermGraph({ onOpenEdit }: EditorTermGraphProps) {
<Overlay <Overlay
layer='z-tooltip' layer='z-tooltip'
position={clsx('top-[1.6rem]', { 'left-[2.6rem]': hoverLeft, 'right-[2.6rem]': !hoverLeft })} position={clsx('top-[1.6rem]', { 'left-[2.6rem]': hoverLeft, 'right-[2.6rem]': !hoverLeft })}
className={clsx('w-[25rem]', 'px-3', 'overflow-y-auto', 'border shadow-md', 'clr-app')} className={clsx('w-[25rem]', 'px-3', 'cc-scroll-y', 'border shadow-md', 'clr-app')}
> >
<InfoConstituenta className='pt-1 pb-2' data={hoverCstDebounced} /> <InfoConstituenta className='pt-1 pb-2' data={hoverCstDebounced} />
</Overlay> </Overlay>

View File

@ -85,7 +85,7 @@ function ViewHidden({ items, selected, toggleSelection, setFocus, schema, colori
'border-x border-b rounded-b-md', 'border-x border-b rounded-b-md',
'clr-input', 'clr-input',
'text-sm', 'text-sm',
'overflow-y-auto' 'cc-scroll-y'
)} )}
style={{ maxHeight: calculateHeight(windowSize.isSmall ? '12.rem + 2px' : '16.4rem + 2px') }} style={{ maxHeight: calculateHeight(windowSize.isSmall ? '12.rem + 2px' : '16.4rem + 2px') }}
initial={false} initial={false}

View File

@ -129,7 +129,7 @@ function ConstituentsTable({ items, activeID, onOpenEdit, maxHeight, denseThresh
<DataTable <DataTable
dense dense
noFooter noFooter
className='text-sm select-none cc-scroll-y overscroll-none' className='text-sm select-none cc-scroll-y'
style={{ maxHeight: maxHeight }} style={{ maxHeight: maxHeight }}
data={items} data={items}
columns={columns} columns={columns}

View File

@ -10,6 +10,7 @@
.cm-editor { .cm-editor {
resize: vertical; resize: vertical;
overflow-y: auto; overflow-y: auto;
overscroll-behavior-y: contain;
border-color: var(--cl-bg-40); border-color: var(--cl-bg-40);
.dark & { .dark & {
border-color: var(--cd-bg-40); border-color: var(--cd-bg-40);

View File

@ -223,6 +223,7 @@
.cc-scroll-y { .cc-scroll-y {
overflow-y: auto; overflow-y: auto;
overscroll-behavior-y: contain;
scroll-snap-type: y mandatory; scroll-snap-type: y mandatory;
} }

View File

@ -133,7 +133,7 @@ export function domTooltipConstituenta(cst?: IConstituenta) {
'dense', 'dense',
'p-2', 'p-2',
'border shadow-md', 'border shadow-md',
'overflow-y-auto', 'cc-scroll-y',
'text-sm font-main' 'text-sm font-main'
); );
@ -200,7 +200,7 @@ export function domTooltipEntityReference(ref: IEntityReference, cst: IConstitue
'dense', 'dense',
'p-2 flex flex-col', 'p-2 flex flex-col',
'border shadow-md', 'border shadow-md',
'overflow-y-auto', 'cc-scroll-y',
'text-sm', 'text-sm',
'select-none cursor-auto' 'select-none cursor-auto'
); );
@ -247,7 +247,7 @@ export function domTooltipSyntacticReference(ref: ISyntacticReference, masterRef
'dense', 'dense',
'p-2 flex flex-col', 'p-2 flex flex-col',
'border shadow-md', 'border shadow-md',
'overflow-y-auto', 'cc-scroll-y',
'text-sm', 'text-sm',
'select-none cursor-auto' 'select-none cursor-auto'
); );