Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9161449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:58:09+00:00 2026-06-17T13:58:09+00:00

At the end or beginning of a Sencha Touch 2 carousel, a user can

  • 0

At the end or beginning of a Sencha Touch 2 carousel, a user can drag the item past where it should be able to go and display the white background (screenshot here: https://i.stack.imgur.com/i10Ak.png). I’m trying to disable this functionality, so a user can’t drag past the end/beginning of a carousel.

I’ve attempted to do this with the various scrollable configurations, including the setup that is typically suggested for dealing with overscrolling

scrollable : {
  direction: 'horizontal',
  directionLock: true,
  momentumEasing:  {
     momentum: {
       acceleration: 30,
       friction: 0.5
     },
     bounce: {
        acceleration: 0.0001,
        springTension: 0.9999,
     },
     minVelocity: 5
  },
  outOfBoundRestrictFactor: 0   
  }

The above configuration, especially outOfBoundRestrictFactor does stop the ability to drag past the end, but it also stops the ability to drag anywhere else in a carousel either…so that doesn’t work. I’ve screwed around with all of the other configurations to no positive effect.

Unfortunately, I haven’t been able to find much on modifying the configurations of dragging. Any help here would be awesomesauce.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:58:11+00:00Added an answer on June 17, 2026 at 1:58 pm

    What you need to do is override the onDrag functionality in Carousel. This is where the logic is to detect which direction the user is dragging, and where you can check if it is the first or last item.

    Here is a class that does exactly what you want. The code you are interested in is right at the bottom of the function. The rest is simply taken from Ext.carousel.Carousel.

    Ext.define('Ext.carousel.Custom', {
        extend: 'Ext.carousel.Carousel',
    
        onDrag: function(e) {
            if (!this.isDragging) {
                return;
            }
    
            var startOffset = this.dragStartOffset,
                direction = this.getDirection(),
                delta = direction === 'horizontal' ? e.deltaX : e.deltaY,
                lastOffset = this.offset,
                flickStartTime = this.flickStartTime,
                dragDirection = this.dragDirection,
                now = Ext.Date.now(),
                currentActiveIndex = this.getActiveIndex(),
                maxIndex = this.getMaxItemIndex(),
                lastDragDirection = dragDirection,
                offset;
    
            if ((currentActiveIndex === 0 && delta > 0) || (currentActiveIndex === maxIndex && delta < 0)) {
                delta *= 0.5;
            }
    
            offset = startOffset + delta;
    
            if (offset > lastOffset) {
                dragDirection = 1;
            }
            else if (offset < lastOffset) {
                dragDirection = -1;
            }
    
            if (dragDirection !== lastDragDirection || (now - flickStartTime) > 300) {
                this.flickStartOffset = lastOffset;
                this.flickStartTime = now;
            }
    
            this.dragDirection = dragDirection;
    
            // now that we have the dragDirection, we should use that to check if there
            // is an item to drag to
            if ((dragDirection == 1 && currentActiveIndex == 0) || (dragDirection == -1 && currentActiveIndex == maxIndex)) {
                return;
            }
    
            this.setOffset(offset);
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I remove all white space from the beginning and end of a
How can I get rid of extra hyphens at the end and beginning of
I can see that Ctrl + left / right jumps to the beginning/end of
The Perl FAQ entry How do I strip blank space from the beginning/end of
In emacs, I use C-M-a and C-M-e to go the beginning/end of functions in
strip_tags only catches tags that have a beginning and end tag. With the strings
Having an IndexedSeq, how to iterate it from the end to the beginning?
I coded the following. Insert, delete at beginning, insert at beginning and end are
I'm beginning to get to my wit's end on this one. I have Jenkins
I have a button I want to use in the beginning and the end

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.