Giter VIP home page Giter VIP logo

mithril-slider's Introduction

mithril-slider's People

Contributors

arthurclemens avatar benmerckx avatar cmnstmntmn avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mithril-slider's Issues

Many window-level events created as slider is shown and hidden

I'm getting double scroll events in Chrome - it looks like an extra set of pointercancel, pointermove and pointerup events are being attached. It doesn't happen every time, and I suspect a timing issue based upon how long the slider takes to render. If the slider is switched out and in again on a redraw of the view, more handlers are added.

double

Here's as stripped-down as I can get the issue. Because it's much simpler, the bug manifests less often, but in more complex code it happens every time.

https://gist.github.com/JohnAnthony/32dc028af0098a1d64adc388b3e3dc25

Turn off touch area / make area interactive.

Hey this is really awesome, am just having a play around with this.

My use-case is to have a carousel of pages to cycle through (not sure if this is the most effective widget for this...!) but I notice that the touch area for swiping occupies the entire div - is there an option to turn this off? Just wanted to check before starting to play around with the internals...

responsive slider

i figured to make it responssive by changing width values from px to vw

const posPx = (i - 1) * 100 + 'vw';

and few other style declarations, got modified this way.

the problem is with .content wraper's width that doesn't get updated (based on it's content)

anyway i managed to fix this, the following way:

i call m.redraw() in the view, at window resize event

window.addEventListener("resize", function(e) {
   m.redraw() //notify view
})

is this ok, or there's a more elegant way to do it ?

Calling a Promise?

I'm getting an immediate crash when I try to use a Promise for pageData:

   pageData: ()=>Promise.resolve([1,2,3,4]),

It starts out with a list.then(), which is fine, but later accesses the Promise illegally with list(). The only way to get data from a promise is with promise.then(). Not sure how that can ever work (except that presumably m.request() supports a call?).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.