Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Input elements do not work #96

Open
frissonlabs opened this issue Jan 18, 2014 · 10 comments
Open

Input elements do not work #96

frissonlabs opened this issue Jan 18, 2014 · 10 comments
Labels

Comments

@frissonlabs
Copy link

No text input can be typed into input elements that are part of the carousel

@danielchindea
Copy link

That is right. No input is working.

@alexgonchar
Copy link

Are there any plans for fixing this issue?

@GrafRaf
Copy link

GrafRaf commented Jan 27, 2014

As workaround i has been added attribute 'rnNoSlide' to input elemts and change method swipeStart in file angular-carousel.js as described bellow

                function swipeStart(coords, event) {
                    //console.log('swipeStart', coords, event);

add this line --> if (event.srcElement.attributes.rnNoSlide) return false;
$document.bind('mouseup', documentMouseUpEvent);
pressed = true;
startX = coords.x;

                    amplitude = 0;
                    timestamp = Date.now();

                    event.preventDefault();
                    event.stopPropagation();
                    return false;
                }

it's work for me, but it is not tested and it is only workaround

@0x-r4bbit
Copy link
Contributor

@GrafRaf maybe you could more elaborate what's the actual issue? What causes input elements not to work? Is this an issue for all input that inside of a carousel?

@GrafRaf
Copy link

GrafRaf commented Jan 30, 2014

i'm try use carousel with form and all work but i can't enter input value
i'm create small example for demonstrate my scenario
http://jsfiddle.net/uDWUs/

@revolunet revolunet added the bug label Feb 10, 2014
@alexgonchar
Copy link

We have problem with inputs (as well as ngClick event and others) because ng-carousel stops propogation of mouse events in its own mouse events handlers:

function swipeStart(coords, event) {
   ...
   event.preventDefault();
   event.stopPropagation();
   return false;
}

and

function swipeEnd(coords, event, forceAnimation) {
   ...
   event.preventDefault();
   event.stopPropagation();
   return false;
}

When commenting out it resolves the issue with inputs.
Why event propogation is stopped in that handlers?

@revolunet
Copy link
Owner

this have been removed in the last version (merge 2 days ago), can you please check its now ok ?

@alexgonchar
Copy link

Yes, it works with latest merge.

One moment abount rnNoSlide: think its better to check for rnNoSlide attr in parents of the element as well.
Something like this (jQuey is used here):

if ($(event.originalEvent.srcElement).parents('*[rn-noslide]').length >= 1) return;

@revolunet
Copy link
Owner

thanks for your feedback

@sanbornhilland
Copy link
Contributor

Are there any recent thoughts on this? Most inputs are working fine for me now except for range/slider inputs. The swipe event on slider gets hijacked so it just moves the carousel instead of the slider.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants