Skip to content

Commit

Permalink
Turn scroll indicator into selectable widget
Browse files Browse the repository at this point in the history
REDMINE-20895
  • Loading branch information
tf committed Feb 4, 2025
1 parent 8553d1d commit c732e11
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 3 additions & 3 deletions entry_types/scrolled/package/src/frontend/Section.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {SectionLifecycleProvider, useSectionLifecycle} from './useSectionLifecyc
import {SectionViewTimelineProvider} from './SectionViewTimelineProvider';
import {withInlineEditingDecorator} from './inlineEditing';
import {BackgroundColorProvider} from './backgroundColor';
import {Widget} from './Widget';
import {SelectableWidget} from './SelectableWidget';

import * as v1 from './v1';
import * as v2 from './v2';
Expand Down Expand Up @@ -80,8 +80,8 @@ const Section = withInlineEditingDecorator('SectionDecorator', function Section(
state={state} />

{section.sectionIndex === 0 &&
<Widget role="scrollIndicator"
props={{sectionLayout: section.layout}} />}
<SelectableWidget role="scrollIndicator"
props={{sectionLayout: section.layout}} />}
</BackgroundColorProvider>
</SectionViewTimelineProvider>
</SectionLifecycleProvider>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import React, {useEffect, useRef} from 'react';
import classNames from 'classnames';

import {ThemeIcon} from 'pageflow-scrolled/frontend';
import {
ThemeIcon,
WidgetSelectionRect
} from 'pageflow-scrolled/frontend';

import styles from './IconScrollIndicator.module.css';

Expand Down Expand Up @@ -33,7 +36,9 @@ export function IconScrollIndicator({configuration, sectionLayout}) {
styles[`size-${configuration.size}`],
styles[`align-${getAlignment(configuration, sectionLayout)}`])}
ref={ref}>
<ThemeIcon name="scrollDown" width={30} height={30} />
<WidgetSelectionRect>
<ThemeIcon name="scrollDown" width={30} height={30} />
</WidgetSelectionRect>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
pointer-events: none;
}

.indicator > * {
display: inline-block;
}

.size-large {
--size: 60px;
}
Expand Down

0 comments on commit c732e11

Please sign in to comment.