Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions litmus/features/window/resize-cursor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Window } from "cx/widgets";

// The resize cursor should show up on the window edges and be cleared on the way back in, falling back to
// pointer (from the draggable CSS class) on the left and crosshair (from the inline style) on the right.

export default (
<cx>
<Window
title="draggable + resizable"
style={{ top: "100px", left: "40px", width: "380px", height: "220px" }}
draggable
resizable
/>
<Window
title="resizable, inline cursor"
style={{ top: "100px", left: "460px", width: "380px", height: "220px", cursor: "crosshair" }}
resizable
/>
</cx>
);
3 changes: 2 additions & 1 deletion litmus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ import "./index.scss";
//import Demo from "./features/grid/CellEditing";
// import Demo from "./features/charts/PointReducer";
// import Demo from "./features/charts/line-graph/LineGraph";
import Demo from "./features/charts/line-graph/SmoothingOvershoot";
// import Demo from "./features/charts/line-graph/SmoothingOvershoot";
import Demo from "./features/window/resize-cursor";
// import Demo from "./bugs/GridDefaultSortFieldClearableSortIssue";
// import Demo from "./bugs/GridFixedColumnsFixedHeaderColumnsPosition";
// import Demo from "./bugs/GridOnFetchRecords";
Expand Down
8 changes: 5 additions & 3 deletions packages/cx/src/widgets/overlay/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -765,9 +765,11 @@ export class OverlayComponent<
widget.handleResize(e, instance, this);
} else {
let prefix = this.getResizePrefix(e);
this.setCustomStyle({
cursor: prefix ? prefix + "-resize" : undefined,
});
if (prefix) this.setCustomStyle({ cursor: `${prefix}-resize` });
else if (this.customStyle.cursor) {
delete this.customStyle.cursor;
if (this.el) this.el.style.cursor = data.style?.cursor ?? "";
}
}
}

Expand Down
Loading