how to set only vertical for perfect scroll in rtl direction

To suppress the scroll bar in X axis simply set suppressScrollX to true as follows.

$(document).ready(function ($) {
    $('.sidebar').perfectScrollbar({
        useBothWheelAxes: false,
        suppressScrollX: true
    })
});

I have a similar issue with RTL layout.

I fixed horizontal scrolling of my sidebar by using css direction: ltr; to perfect-scrollbar element (<div class="sidebar"> in my case) and then direction: rtl; to inner elements (<div class="sidebar-body"> in may case).

<body class="rtl">
  <div class="sidebar">
    <div class="sidebar-body">
      .......
    </div>
  </div>
</body>

.

.rtl {
  direction: rtl;
  text-align: right;
  .sidebar {
    direction: ltr; // This is the fix
    .sidebar-body {
      direction: rtl; // Then change to rlt back
    }
  }
}

I hope this will help you. sorry for my bad English :)