Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 44a979d

Browse files
committed
fix(styling): better support of auto width on drop menu
1 parent 80b4d56 commit 44a979d

21 files changed

+68
-75
lines changed

src/app/examples/grid-angular.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ export class GridAngularComponent implements OnInit {
229229
field: 'id',
230230
formatter: () => `<div class="fake-hyperlink">Action <i class="fa fa-caret-down"></i></div>`,
231231
cellMenu: {
232-
width: 175,
233232
commandTitle: 'Commands',
234233
commandItems: [
235234
{

src/app/examples/grid-composite-editor.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ export class GridCompositeEditorComponent implements OnInit {
321321
formatter: () => `<div class="button-style margin-auto" style="width: 35px;"><span class="fa fa-chevron-down text-primary"></span></div>`,
322322
cellMenu: {
323323
hideCloseButton: false,
324-
width: 175,
325324
commandTitle: 'Commands',
326325
commandItems: [
327326
{

src/app/examples/grid-contextmenu.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
185185
formatter: actionFormatter,
186186
cellMenu: {
187187
hideCloseButton: false,
188-
width: 200,
189188
// you can override the logic of when the menu is usable
190189
// for example say that we want to show a menu only when then Priority is set to 'High'.
191190
// Note that this ONLY overrides the usability itself NOT the text displayed in the cell,
@@ -354,7 +353,6 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
354353
getContextMenuOptions(): ContextMenu {
355354
return {
356355
hideCloseButton: false,
357-
width: 200,
358356
// optionally and conditionally define when the the menu is usable,
359357
// this should be used with a custom formatter to show/hide/disable the menu
360358
menuUsabilityOverride: (args) => {

src/app/examples/grid-custom-tooltip.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ export class GridCustomTooltipComponent implements OnInit {
270270
excludeFromExport: true,
271271
cellMenu: {
272272
hideCloseButton: false,
273-
width: 175,
274273
commandTitle: 'Commands',
275274
commandItems: [
276275
// array of command item objects, you can also use the "positionOrder" that will be used to sort the items in the list

src/app/examples/grid-menu.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class GridMenuComponent implements OnInit, OnDestroy {
8989
menuUsabilityOverride: (args) => true,
9090

9191
// all titles optionally support translation keys, if you wish to use that feature then use the title properties with the 'Key' suffix (e.g: titleKey)
92-
// example "customTitle" for a plain string OR "customTitleKey" to use a translation key
92+
// example "commandTitle" for a plain string OR "commandTitleKey" to use a translation key
9393
commandTitleKey: 'CUSTOM_COMMANDS',
9494
iconCssClass: 'fa fa-ellipsis-v', // defaults to "fa-bars"
9595
hideForceFitButton: true,

src/app/examples/grid-resize-by-content.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ export class GridResizeByContentComponent implements OnInit {
262262
formatter: () => `<div class="button-style margin-auto" style="width: 35px;"><span class="fa fa-chevron-down text-primary"></span></div>`,
263263
cellMenu: {
264264
hideCloseButton: false,
265-
width: 175,
266265
commandTitle: 'Commands',
267266
commandItems: [
268267
{

src/app/modules/angular-slickgrid/global-grid-options.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export const GlobalGridOptions: Partial<GridOption> = {
5050
iconExportCsvCommand: 'fa fa-download',
5151
iconExportExcelCommand: 'fa fa-file-excel-o text-success',
5252
iconExportTextDelimitedCommand: 'fa fa-download',
53-
width: 200,
5453
},
5554
customFooterOptions: {
5655
dateFormat: 'YYYY-MM-DD, hh:mm a',

test/cypress/integration/example01.spec.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('Example 1 - Basic Grids', { retries: 1 }, () => {
4141

4242
cy.get('.slick-header-menu')
4343
.should('be.visible')
44-
.children('.slick-header-menu-item:nth-child(4)')
44+
.children('.slick-header-menu-item:nth-of-type(4)')
4545
.children('.slick-header-menu-content')
4646
.should('contain', 'Sort Descending')
4747
.click();
@@ -66,7 +66,7 @@ describe('Example 1 - Basic Grids', { retries: 1 }, () => {
6666

6767
cy.get('.slick-header-menu')
6868
.should('be.visible')
69-
.children('.slick-header-menu-item:nth-child(3)')
69+
.children('.slick-header-menu-item:nth-of-type(3)')
7070
.children('.slick-header-menu-content')
7171
.should('contain', 'Sort Ascending')
7272
.click();
@@ -85,7 +85,7 @@ describe('Example 1 - Basic Grids', { retries: 1 }, () => {
8585

8686
it('should hover over the "Duration" column of 2nd grid, Sort Ascending and have 2 sorts', () => {
8787
cy.get('#grid2')
88-
.find('.slick-header-column:nth-child(2)')
88+
.find('.slick-header-column:nth-of-type(2)')
8989
.trigger('mouseover')
9090
.children('.slick-header-menu-button')
9191
.invoke('show')
@@ -94,7 +94,7 @@ describe('Example 1 - Basic Grids', { retries: 1 }, () => {
9494
cy.get('#grid2')
9595
.find('.slick-header-menu')
9696
.should('be.visible')
97-
.children('.slick-header-menu-item:nth-child(4)')
97+
.children('.slick-header-menu-item:nth-of-type(4)')
9898
.click();
9999

100100
cy.get('#grid2')
@@ -238,7 +238,7 @@ describe('Example 1 - Basic Grids', { retries: 1 }, () => {
238238

239239
cy.get('#grid1')
240240
.get('.slick-grid-menu:visible')
241-
.find('span.close')
241+
.find('.close')
242242
.click({ force: true });
243243

244244
cy.get('#grid1')
@@ -286,7 +286,7 @@ describe('Example 1 - Basic Grids', { retries: 1 }, () => {
286286

287287
cy.get('#grid2')
288288
.get('.slick-grid-menu:visible')
289-
.find('span.close')
289+
.find('.close')
290290
.click({ force: true });
291291

292292
cy.get('#grid2')
@@ -328,7 +328,7 @@ describe('Example 1 - Basic Grids', { retries: 1 }, () => {
328328

329329
cy.get('#grid1')
330330
.get('.slick-grid-menu:visible')
331-
.find('span.close')
331+
.find('.close')
332332
.click({ force: true });
333333

334334
cy.get('#grid1')
@@ -356,7 +356,7 @@ describe('Example 1 - Basic Grids', { retries: 1 }, () => {
356356

357357
cy.get('.slick-columnpicker')
358358
.find('.slick-columnpicker-list')
359-
.children('li:nth-child(3)')
359+
.children('li:nth-of-type(3)')
360360
.children('label')
361361
.should('contain', '% Complete')
362362
.click();
@@ -372,7 +372,7 @@ describe('Example 1 - Basic Grids', { retries: 1 }, () => {
372372

373373
cy.get('#grid2')
374374
.get('.slick-columnpicker:visible')
375-
.find('span.close')
375+
.find('.close')
376376
.trigger('click')
377377
.click();
378378
});
@@ -445,7 +445,7 @@ describe('Example 1 - Basic Grids', { retries: 1 }, () => {
445445

446446
cy.get('#grid1')
447447
.get('.slick-grid-menu:visible')
448-
.find('span.close')
448+
.find('.close')
449449
.click({ force: true });
450450
});
451451
});

test/cypress/integration/example03.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ describe('Example 3 - Grid with Editors', { retries: 1 }, () => {
157157

158158
cy.get('.slick-header-menu')
159159
.should('be.visible')
160-
.children('.slick-header-menu-item:nth-child(6)')
160+
.children('.slick-header-menu-item:nth-of-type(6)')
161161
.children('.slick-header-menu-content')
162162
.should('contain', 'Remove Filter')
163163
.click();

test/cypress/integration/example05.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ describe('Example 5 - OData Grid', () => {
699699

700700
cy.get('.slick-header-menu')
701701
.should('be.visible')
702-
.children('.slick-header-menu-item:nth-child(6)')
702+
.children('.slick-header-menu-item:nth-of-type(6)')
703703
.children('.slick-header-menu-content')
704704
.should('contain', 'Remove Filter')
705705
.click();

0 commit comments

Comments
 (0)