Giter Site home page Giter Site logo

designbyadrian / react-input-with-drag Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 3.0 218 KB

Lightweight, zero-dependency, number input component with mouse drag actions just like in Blender and 3D Studio Max.

License: MIT License

JavaScript 99.24% HTML 0.03% TypeScript 0.73%
blender input-method react reactjs

react-input-with-drag's Introduction

With over 15 years of experience in web development, I design and build mobile and desktop web apps using tools like Node.js and Angular. With past work in graphics and interaction design, and studies in computer science and human-computer interaction (HCI), I am Designer Slash Developer.

🎨 Creative Suite

History in desktop publishing, with over a decade of experience with the tools including Illustrator, PageMaker/InDesign, and, nowadays, the Affinity collection.

πŸ‘½ UI/UX

University studies in Human-Computer Interaction, experience in prototyping and field testing, and devote in the school of Nielsen Norman.

πŸ’Ύ Computer Science

Foundation in computer history, networking, and object-oriented programming. Java. Don’t kill me.

Adrian von Gegerfelt, Sweden

react-input-with-drag's People

Contributors

designbyadrian avatar mackan92 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mackan92 fitzmode

react-input-with-drag's Issues

"min" property

If the min property is set to 0 then it is not taken into account.

I believe following condition is invalid:

if (props.min) newValue = Math.max(newValue, +props.min);

It should be:

if (props.min != undefined) newValue = Math.max(newValue, +props.min);

Cannot update a component (X) while rendering a different component (Y). To locate the bad setState() call inside

Thrown as soon as you drag.

The error references this article: facebook/react#18178 (comment), and points to this pile of code inside dist/index.esm.js

function te(ne) {
  var I = ne, { value: e, style: t2 = {}, modifiers: n = {}, onChange: r, onInput: a } = I, i = C(I, ["value", "style", "modifiers", "onChange", "onInput"]);
  let [y, v2] = (0, import_react22.useState)(""), [p, c] = (0, import_react22.useState)(""), K = (0, import_react22.useRef)(0), l = (0, import_react22.useRef)(null), L = i.step ? +i.step : 1, q = M({ shiftKey: 0.1 }, n), [, x] = (0, import_react22.useState)([0, 0]), z = { cursor: "ew-resize", _style: t2 }, O = (u2) => {
    let o = u2.target.value;
    v2(o), !isNaN(+o) && (r == null || r(+o, l.current));

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.