Make the Angular Modal scrollable except for when a specific div is being click dragged

I am working on an Ionic app that uses AngularJS. One issue I encountered is with a modal popup that can sometimes extend beyond the visible area.

To address this, we applied overflow: hidden to its CSS class.

However, there is a specific functionality in this modal where users can draw lines on the map by clicking and dragging. These lines are drawn perfectly within a <div> element.

Is there a way to prevent click-drag actions when a user initiates a click within this <div> tag?

Update: I still need assistance. The modal was displaying behavior similar to what is described in this post: How to make modal scroll with main page

Currently, my code looks like this:

<ion-modal-view class="my-modal">
  <ion-content style="position:absolute">
      <div class="row main-wrapper">
          <div class="left-panel-wrapper {{setSize}} col-25" >
              <div ng-show="!showMyPlans || loading" class="left-panel {{setSize}} item-animate">
                  <h3>My Plan Templates</h3>
                  <p>Select a template from the left or select to start from scratch.</p>
                  <ion-content scroll='true' class="left-panel-template">
                      <div ng-repeat="template in templates" ng-class-even="'float-right'" ng-class-odd="'float-left'">
                          <div class="usemouse graph-bg templates-bg {{setSize}}">
                              <div data-drag="true" ng-model="templates" jqyoui-draggable="{index:{{$index}}, placeholder: 'keep', deepCopy: true}" data-jqyoui-options="{revert: 'invalid', helper: 'clone', containment: '.my-modal'}">
                                  <svg ng-style="{'position': 'absolute', 'height': '{{rawSmallSize}}px', 'width': '{{rawSmallSize}}px'}" ng-repeat="line in template.lines">
                                      <line ng-attr-x1="{{line.x1*smscale}}" ng-attr-y1="{{line.y1*smscale}}" ng-attr-x2="{{line.x2*smscale}}" ng-attr-y2="{{line.y2*smscale}}"></line>
                                  </svg>
                              </div>
                              <div ng-show="template.lines.length == 0" class="usemouse graph-bg templates-bg {{setSize}} templates-blank text-center" style="margin-top:0" on-tap="newBlankPlan();">
                                  <h6  style="margin-top:0" >Blank</h6>
                              </div>
                          </div>
                      </div>
                  </ion-content>
              </div>

Answer №1

To address the wiggle problem, we resolved it by completely eliminating any padding within the modal.

<ion-content style="position:absolute; padding-top:0">
    <div class="row main-wrapper">
        <div class="left-panel-wrapper {{setSize}} col-25" >

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

Exploring AngularJS with Filtering for Advanced Search Results

Currently, I have a search box that successfully searches values in a table using my code. <tr ng-repeat="b in bugs | filter:searchText"> Now, I want to take it one step further by allowing users to search specific columns if they include a colon i ...

The data type 'Observable<any>' cannot be assigned to the type 'StoresSummaryResults'. The property 'Data' is not present in the 'Observable<any>' type

As a newcomer to using the Observable with Angular 2, I am facing an issue where my structure is not receiving the results despite being able to validate the response from my REST API. Below is the data class in Typescript that I have: import { RESTResul ...

ScrollSpy Plugin in JQuery - Implementing automatic vertical text scrolling with dynamic height customization

I have been using this code to display the most recent user comments on my website, where some comments are concise while others are more lengthy. If you inspect the source code, you will notice that the height is set to 90px and overflow is set to hidden ...

Challenges with cascading style sheets and the integration of PHP's include function

I am currently working on a PHP website project. I have implemented the include function in my main page to include other files, but I am facing an issue with the CSS when loading the main page. The CSS in the included files seems to be all messed up, maki ...

In Firefox, the focus outline is not shown on a div that has a mask-image CSS rule applied to

In my code, I have multiple div elements that have the mask-image and -webkit-mask-image CSS rules applied to them. These divs are being used as UI slider components, so I want keyboard users to be able to tab between them and use the arrow keys to adjust ...

Displaying image titles when the source image cannot be located with the help of JavaScript or jQuery

I am currently facing an issue where I need to display the image title when the image is broken or cannot be found in the specified path. At the moment, I only have the options to either hide the image completely or replace it with a default image. $(&apo ...

There seems to be a glitch with the Flask flash messaging feature, as

My Flask application includes login and register routes where I aim to display flash messages when username passwords are not matched. Specifically, this issue arises in my index and login routes: @app.route('/') @login_required def index(): ...

Can the functionality of a button be disabled after being clicked a total of 5 times?

Once a user clicks the button five times, I plan for it to be disabled. Can this be achieved solely with HTML, or would JavaScript be necessary? ...

Is it possible to save ng-bind values into a PHP string?

As a newcomer to AngularJS with some PHP knowledge, I am curious about the possibility of storing ng-bind values in a PHP string. For instance: <li ng-if="jSEO.resources[3][0][0]"> <span> Internal Links:</span> <font color="#000000" ...

Custom background options for Wordpress developer

I have been exploring the WordPress codex to learn about incorporating custom background options, similar to this example $defaults = array( 'default-color' => '', 'default-image' => '&apo ...

Initiate the countdown when the button is pushed

Recently ran into an issue where a button triggers a command to a Perl script, causing the page to continuously load for 60 seconds. To provide users with transparency on when the Perl script will be finished running, I implemented a JavaScript countdown t ...

Using an external filter within the ng-grid component

Currently, I am facing a challenge with implementing filter functionality in my table using three search fields - name, target, and reach. The first two filters are working well, but the last one needs to filter by lower-than or higher-than comparison. To ...

How to set DIVS to be hidden when the page first loads

I am currently working on a project where I need to use JavaScript to hide certain <div> elements when the page loads. I have also included jQuery in my code. Below is what I have tried so far: $(document).ready(function() { hide(); function hid ...

Having trouble getting jQuery .click to trigger on a dynamically loaded button?

I'm having some trouble with my code. I have a list that loads dynamically with a button inside, and although I have set up jQuery to handle the click event, nothing is happening. Here's a snippet of the code: HTML: <ul id="cart"> ...

Looking for a list that you can edit with CSS styling?

I'm struggling to create a flexible list that can be easily modified. My goal is to have an ordered list with unique labels such as 1,2,3,4,5,6,7,8,9,0,A,B,!,# Although I've managed to number the list items, I am stuck on adding the extra label ...

Internet Explorer 10 offers 3D transformation capabilities

My 3D rotating image carousel works well in Chrome and Firefox but not in IE. I am aware that IE10+ does not fully support the preserve-3d tag, and although there are workarounds by applying transforms to the children instead, I have been unsuccessful in ...

Ways to expand the height of content using grid?

I'm having trouble getting my grid template to stretch content to the end using CSS Grid. The behavior is unexpected, and I want to create a Jeopardy game where clicking on a box reveals a question. Initially, I applied display: grid to the body elem ...

Adding the header.php file in WordPress caused the style.css to stop working

Whenever I include a basic "header.php" file in my theme directory, my style.css mysteriously stops working. But when I remove the "header.php" file, everything goes back to normal. How can I troubleshoot this issue? Below is the code snippet from my fil ...

Enhance your website navigation with Bootstrap Scrolling Nav: maintain consistent section heights and highlight the active

Can you help me with an issue I'm having when clicking on the <a> link in the navigation? The anchor point seems to be misplaced as the section headline (<h2>) is not visible. Is there a way to highlight the <a> links, perhaps by add ...

Troubleshooting the malfunctioning of the Bootstrap slide animation

I've been attempting to implement scroll animation on a div, but for some reason, it's not working as intended. I must have made a mistake somewhere, but I can't figure out where. Any help in resolving this issue would be greatly appreciated ...