Skip to content

Commit 10dd7f4

Browse files
authored
Merge branch 'master' into mkirova/splitter-spec-changes
2 parents 3531097 + 4000a7c commit 10dd7f4

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

projects/igniteui-angular/src/lib/core/styles/components/splitter/_splitter-theme.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
align-items: center;
9494
background: $splitter-color;
9595
border: 1px solid $splitter-color;
96-
cursor: row-resize;
9796
z-index: 99;
9897
opacity: .68;
9998
transition: opacity .15s $ease-out-quad !important;
@@ -123,7 +122,6 @@
123122
%igx-splitter-bar--vertical {
124123
flex-direction: column;
125124
height: 100%;
126-
cursor: col-resize;
127125

128126
&::before {
129127
@extend %handle-area--vertical;

projects/igniteui-angular/src/lib/splitter/splitter-bar/splitter-bar.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div class="igx-splitter-bar"
22
[class.igx-splitter-bar--vertical]='type === 0'
3+
[style.cursor]='cursor'
34
igxDrag
45
[ghost]="false"
56
[dragDirection]='dragDir'

projects/igniteui-angular/src/lib/splitter/splitter-bar/splitter-bar.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ export class IgxSplitBarComponent {
5252
return this.type === SplitterType.Horizontal ? 'horizontal' : 'vertical';
5353
}
5454

55+
/**
56+
* @hidden
57+
* @internal
58+
*/
59+
public get cursor() {
60+
if (this.resizeDisallowed) {
61+
return '';
62+
}
63+
return this.type === SplitterType.Horizontal ? 'col-resize' : 'row-resize';
64+
}
65+
5566
/**
5667
* Sets/gets the `SplitPaneComponent` associated with the current `SplitBarComponent`.
5768
* @memberof SplitBarComponent

projects/igniteui-angular/src/lib/splitter/splitter.component.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,15 @@ describe('IgxSplitter', () => {
125125
});
126126

127127
it('should not allow drag resize if resizable is set to false.', () => {
128+
const splitterBarComponent = fixture.debugElement.query(By.css(SPLITTERBAR_CLASS)).context;
129+
expect(splitterBarComponent.cursor).toBe('col-resize');
128130
const pane1 = splitter.panes.toArray()[0];
129131
pane1.resizable = false;
130-
const splitterBarComponent = fixture.debugElement.query(By.css(SPLITTERBAR_CLASS)).context;
132+
fixture.detectChanges();
131133
const args = {cancel: false};
132134
splitterBarComponent.onDragStart(args);
133135
expect(args.cancel).toBeTruthy();
136+
expect(splitterBarComponent.cursor).toBe('');
134137
});
135138

136139
it('should allow resizing with up/down arrow keys', () => {

0 commit comments

Comments
 (0)