Skip to content

Commit

Permalink
fix(html): toolbar scroll buttons should be around by default
Browse files Browse the repository at this point in the history
  • Loading branch information
TeyaVes committed Jan 24, 2025
1 parent 63c3bec commit 6917fb0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions packages/html/src/toolbar/tests/toolbar-fill-modes.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button } from '../../button';
import { ColorPicker } from '../../colorpicker';
import { ButtonGroup } from '../../button-group';
import { ToolbarItem, ToolbarSeparator, ToolbarResizable, Toolbar, ToolbarScrollable } from '../../toolbar';
import { ToolbarItem, ToolbarSeparator, ToolbarResizable, Toolbar, ToolbarScrollableButtonsHidden } from '../../toolbar';

import { Combobox, MenuButton } from '../..';

Expand Down Expand Up @@ -52,7 +52,7 @@ export default () =>(
</section>
<span className="k-colspan-all k-col-span-full">{fillMode} with overlay</span>
<section className="k-colspan-all k-col-span-full">
<ToolbarScrollable fillMode={fillMode}>
<ToolbarScrollableButtonsHidden fillMode={fillMode}>
<Button icon="arrow-rotate-ccw" fillMode={fillMode}></Button>
<Button icon="arrow-rotate-cw" fillMode={fillMode}></Button>
<ToolbarSeparator></ToolbarSeparator>
Expand Down Expand Up @@ -88,7 +88,7 @@ export default () =>(
<MenuButton fillMode={fillMode} icon="align-middle" showArrow></MenuButton>
<ToolbarSeparator></ToolbarSeparator>
<Button fillMode={fillMode} icon="text-wrap"></Button>
</ToolbarScrollable>
</ToolbarScrollableButtonsHidden>
</section>
</>
))}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default () =>(

<span className="k-colspan-all k-col-span-full">Toolbar Buttons Around</span>
<section className="k-colspan-all k-col-span-full">
<ToolbarScrollable scrollButtons="around" />
<ToolbarScrollable />
</section>

<span className="k-colspan-all k-col-span-full">Toolbar Buttons Start</span>
Expand Down
7 changes: 4 additions & 3 deletions packages/html/src/toolbar/toolbar.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export type KendoToolbarState = { [K in (typeof states)[number]]?: boolean };
const defaultOptions = {
size: Size.medium,
fillMode: FillMode.solid,
scrollButtons: 'around'
};

export const Toolbar = (
Expand Down Expand Up @@ -189,15 +190,15 @@ export const Toolbar = (
{
[`${TOOLBAR_CLASSNAME}-resizable`]: resizable,
[`${TOOLBAR_CLASSNAME}-scrollable`]: scrollable,
[`${TOOLBAR_CLASSNAME}-scrollable-overlay`]: (scrollable && (scrollButtons === 'hidden' || !scrollButtons)),
[`${TOOLBAR_CLASSNAME}-scrollable-overlay`]: (scrollable && scrollButtons === 'hidden'),
[`${TOOLBAR_CLASSNAME}-scrollable-${scrollingPosition}`]: scrollingPosition,
[`${TOOLBAR_CLASSNAME}-section`]: section,
}
)}
>
{!scrollable && toolbarChildren}

{scrollable && (scrollButtons === 'hidden' || !scrollButtons) &&
{scrollable && scrollButtons === 'hidden' &&
<span className='k-toolbar-items k-toolbar-items-scroll'>{toolbarChildren}</span>
}

Expand All @@ -223,7 +224,7 @@ export const Toolbar = (
</>
}

{scrollable && scrollButtons === 'around' &&
{scrollable && (scrollButtons === 'around' || !scrollButtons) &&
<>
<Button fillMode={fillMode} size={size} icon="caret-alt-left" className="k-toolbar-prev"></Button>
<ToolbarSeparator className="k-toolbar-button-separator" />
Expand Down

0 comments on commit 6917fb0

Please sign in to comment.