Issues with border removal due to overflow content in CSS and AngularJS

There seems to be a peculiar issue with overflow content in my application. When you scroll horizontally on the codepen, you'll notice that the border on the .track or perhaps the .cell divs disappears. Any assistance would be greatly appreciated.

HTML

<section ng-app="netJamApp">
  <section ng-controller="ProjectController" id="project">
    <div class="tracks">
      <div ng-repeat="i in getNumber(pref.NUM_TRACKS) track by $index" class="track">
        <div ng-repeat="i in getNumber(cellsPerTrack(240)) track by $index" class="cell"></div>
      </div>
    </div>
  </section>
</section>

CSS

#project {
  padding: 20px;
}
#project .tracks {
  overflow-x: auto;
  display: flex;
  flex-direction: column;
}
#project .tracks .track {
  font-size: 30px;
  list-style-type: none;
  display: flex;
}
#project .tracks .track:first-child {
  border: 1px solid #343436;
}
#project .tracks .track:not(first-child) {
  border: 1px solid #343436;
  border-top: none;
}
#project .tracks .cell {
  min-width: 80px;
  height: 50px;
  background: #272822;
  border-right: 2px solid #343436;
}

@keyframes slideInLeft {
  from {
    transform: translate3d(-100%, 0, 0);
    visibility: visible;
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
.slide-in-left {
  animation-name: slideInLeft;
  animation-duration: 250ms;
  visibility: visible !important;
}

Angular

var app = angular.module('netJamApp', []);

/* PROJECT CONTROLER */
app.controller('ProjectController', ['$scope', function($scope) {

  // INIT SCOPE VARS
  $scope.pref = {};
  $scope.pref.NUM_TRACKS = 5;
  $scope.pref.MIN_CELLS_PER_TRACK = 20;
  $scope.pref.CELL_LENGTH = 15;
  $scope.pref.PADDING_CELLS = 10;

  // HELPERS 

  //used for ng-repeat to repeat a given number of times
  $scope.getNumber = function(num) {
    return new Array(num);
  };

  // determine the number of cells to insert inside of a track
  $scope.cellsPerTrack = function(audioclip_len) {
    var cells = audioclip_len / $scope.pref.CELL_LENGTH + $scope.pref.PADDING_CELLS;
    return Math.ceil(Math.max(cells, $scope.pref.MIN_CELLS_PER_TRACK));
  };
}]);
/* project controller */

Answer №1

In order to resolve the issue, it is necessary to utilize the outline CSS rule rather than the border.

To rectify this in your CSS code, you can make the following adjustment:

.cell {
  min-width: 80px;
  height: 50px;
  background: $sublime-black;
  //border-right: 2px solid $codepen-grey;  <-- replace with outline
  outline:2px solid $codepen-grey;
}

View working example on Codepen

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Use ngFor to align items to the left in your design

I am working on a div element where I need to dynamically add inputs that should form a number with a specific format. To ensure the inputs start from the left, I have applied the justify-content-end class. HTML: <div class='row justify-content-end ...

Getting information from MongoDB using Node.js and Angular

Currently, I am facing difficulty in retrieving data from MongoDB (I'm also using Mongoose) and sending it to Angular in order to populate the ng-repeat list with the retrieved data. I have managed to either display the data on a blank page directly f ...

iFrames fail to return a response when using postMessage

I am currently in the process of constructing a modal that contains iFrame content. Within this modal, I have implemented a Dropbox upload function. My goal is to have the information posted back to the original site when a user successfully uploads an ima ...

Script to pop up cancel alert box

There's a dilemma with this code - if you click CANCEL the first time the box pops up, it continues to run. I'm unsure of how to make it redirect to the underlying page when clicked on cancel for the first time. var numero= prompt ("Enter a nu ...

Displaying data on View is not working after navigation

I'm facing an issue where the data is not displaying on the view after routing, even though it appears in the console. Surprisingly, if I don't change the view, the data shows up. Additionally, if I call the service directly from the view, I can ...

What could be causing the issue of nth-child blocking the functionality of a:hover styles?

I have a unique collection of images that are styled to resemble polaroid pictures. Each image is given a slight rotation. a.polaroid { transform: rotate(-2deg); } On hover, a scale transformation is applied. a.polaroid:hover { transform: scale(1 ...

The max-width attribute is failing to apply to the form within the Bootstrap framework

login.html file: {% extends "base.html" %} {% block content %} <div class="container login-page-form"> <form id="login-form" action="/auth/login" method="post"> <div class="f ...

React to the Vue: Only activate the event if the key is pressed twice consecutively

In my application, I am creating a unique feature where users can trigger a window to appear by inputting the symbol @ (shift + 50). This will allow them to access predefined variables... <textarea @keyup.shift.50="showWindow"></textarea> My ...

Utilizing an Entity's Location for triggering an Action in AFrame

Looking to create a custom component that can track the position of a sphere within an AFrame scene and trigger an event when it reaches a specific coordinate (for example, resetting to its default position as shown below): AFRAME.registerComponent("t ...

What is the best way to populate a dropdown menu with data and enable users to search for specific items by typing them in?

I need assistance with populating data in a drop-down box that is not pre-defined. The data needs to be dynamically created and then displayed in the drop-down box. Currently, the data is being shown using check boxes, but I want it to appear in a drop-dow ...

GraphQL query must receive an object for the Mongo filter, but instead, it received a string

Is there a way to pass a filter option to MongoDB using GraphQL? I attempted to do it in a certain way, but encountered an error that stated: "message": "Parameter \"filter\" to find() must be an object, got {email: "<a href="/cdn-cgi/l/email ...

Unable to display array values (using jQuery)

Help! I am having trouble rendering all my values. I have names (buttons) and when I click on them, I want to render the array behind it. Using .append() works, but the issue is that when I click again, it doesn't refresh and gets stacked. I am thinki ...

Utilizing Material UI's React framework for maintaining uniform grid column heights

Take a look at the image provided for context. I am facing an issue with two div elements, where one should occupy 20% of the total browser height and the other should take up 80%. Currently, I am utilizing Material UI Grid for positioning, which looks lik ...

issues with the redirection functionality in the Play framework

I am currently working on an application that extracts data from Twitter profiles. I want to give the user the ability to select which parts of their profile should be used (for example, excluding tweets). To accomplish this, I plan to incorporate checkb ...

Sending a string of HTML elements to a Vue custom directive is causing problems with the eslint code analysis

I have developed two custom Vue directives to add an HTML element before or after another element. I provide an HTML string to the element where I apply the directive, but I am encountering an error in VS Code: Parsing error: unexpected-character-in-a ...

What is causing the inconsistency in the widths of these HTML elements?

I recently created multiple div elements with a uniform width of 5px. Here is the CSS code I used: div { background-color: black; width: 5px; height: 100px; display: inline-block; } To my surprise, despite setting the same width for all divs, som ...

Comparing Dates in Node.js using JavaScript and Sorting Arrays based on Date Values

Is JavaScript lacking a basic Date comparison feature similar to Python? Within my Node.js script, these lines are present: console.log(Date(2012,11,10) < Date(2012, 11, 9)) console.log(Date(2012,11,10) > Date(2012, 11, 9)) Surprisingly, both of t ...

Modifying the CSS for a single page - specifically the contact us page - on a WordPress website

Recently, I developed a Wordpress website for a client. However, the client has a unique request - they want the Contact Us page to have a different design compared to the other pages on the site. I attempted to create a separate CSS file for the Contact ...

creating URLs using javascript

I am seeking guidance on how to dynamically generate URLs for different languages using JavaScript. When the server sends JSON data to the frontend, I have a header file and a helper function that helps in creating URLs in JavaScript. I am trying to figu ...

Is there a way to include an edit, delete, details, and create new icon in an @html.actionLink within MVC?

This HTML code is specific to MVC and represents the formatting used: 1. @*@Html.ActionLink("Delete", "Delete", new { id=item.ActivityDepreciationTypeId })*@ 2. @*@Html.ActionLink("Details", "Details", new { id=item.ActivityDepreciationTypeId })*@ ...