question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom actions with icons overlap

See original GitHub issue

Hi All, I am having major issues getting custom actions to render, can someone please help?

I have set up my settings like so:

  settings = {
    actions:{
      add:false,
      edit:false,
      delete:false,
      custom: [
        {
          name: 'accept',
          title: '<i class="nb-checkmark inline-block width: 50px"></i>',
        },
        {
          name: 'deny',
          title: '<i class="nb-close inline-block width: 50px"></i>',
        },
      ],
    },
    columns: {
      mmsi: {
        title: 'MMSI',
        editable: false,
      },
      state: {
        title: 'State',
        editable: false,
      },
      vendor: {
        title: 'Vendor',
        editable: false,
      },
      userid: {
        title: 'UserId',
        editable: false,
      },
    },
  };
}

this produces:

Screenshot 2020-08-13 at 22 52 00

I found on another issue that someone had added the following CSS to override the defaults:

:host ::ng-deep tr .ng2-smart-actions{ display: flex; }

:host ::ng-deep nbng2-st-tbody-custom {display: flex;}

:host ::ng-deep ng2-st-tbody-edit-delete a.ng2-smart-action {display: inline-block !important;}
:host ::ng-deep ng2-st-tbody-create-cancel a.ng2-smart-action {display: inline-block !important;}
:host ::ng-deep ng2-st-tbody-custom a.ng2-smart-action.ng2-smart-action-custom-custom {
    display: inline-block;
    width: 80px;
    text-align: center;
}

But this produces this output:

Screenshot 2020-08-13 at 22 59 10

The buttons are not aligned, the actions border is messed up, and the other columns on the actions look like they are 1 pixel out.

Please, does anyone know how to resolve?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
Whisper40commented, Jan 9, 2021

@michabbb Thanks for your solution !

The same thing for the right side ( with a perfect display without border 😉 )

.order-table {

  thead th.ng2-smart-actions.ng-star-inserted {
    width: 1em;
  }

  td.ng2-smart-actions {
    float: right !important;

    ng2-st-tbody-custom {
      float: right;
      width: auto;
      display: flex;
      margin-top: 0.5em;
      margin-left: 1em;

      a.ng2-smart-action.ng2-smart-action-custom-custom {
        margin-right: 0.5em;
      }
    }
  }
}

.nb-theme-default ng2-smart-table .ng2-smart-actions a.ng2-smart-action:not(:last-child){
  border-right: 0px;
}
0reactions
Danielitouci96commented, Aug 5, 2022

I have the same problem, some answer to this, the one from jupmorenorde I improve it, but it keeps staying like this… Anotación 2022-08-05 001349

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add custom action button - ng2-smart-table - Stack Overflow
I'm trying to add a button to custom action, but a new column is not added in the action ...
Read more >
Custom Actions, Create Your Own Contest Entry Types - Gleam
Custom actions, customize and create your own actions ... custom action types, you can also give them custom icons using the icon code...
Read more >
Create Custom Actions for the Dispatcher Console
Icon : Select an icon to display next to the action label. Click Save. Optionally, reorder the actions in the action category you...
Read more >
Customizing action button appearance
Is there a way to color action buttons? I have different icons for them, but being able to color them separately would help...
Read more >
Custom:Button-card overlapping with previous one
Anyone can help me (I am not really familier with CSS) ? Thanks. - type: custom:button-card entity: 'climate.cuisine_m' aspect_ratio: 1/1 icon: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found