Code Monkey home page Code Monkey logo

Comments (4)

nikku avatar nikku commented on July 26, 2024 1

We could consider to change the FEEL editor change handler once we settled on unifying the behavior.

from dmn-js.

barmac avatar barmac commented on July 26, 2024

Additional context:

There is a difference between how change events are handled in text inputs and contenteditable elements. For a text input, you can listen to a change event which is dispatched only on blur and if input value was changed. In contrast, contenteditable does not fire the change event, and a common solution is to listen to the input . However, it behaves differently as input event is dispatched after each keystroke. In a naive implementation of contenteditable, we may flood the editor command stack with changes which leads to a problems like in #859
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event

https://camunda.slack.com/archives/GP70M0J6M/p1715331428555569

from dmn-js.

barmac avatar barmac commented on July 26, 2024

The FEEL editor relies on CodeMirror's updateListener to call the change handler. However, such updates behave much more closely to the browser input events, as the handler is called each time the editor view updates. This is way too often, so in the LiteralExpression component we should emulate browser's change event behavior, i.e. call the handler only on blur when the value changed.

from dmn-js.

barmac avatar barmac commented on July 26, 2024

Agreed, but that means a breaking change if we modify the onChange callback behavior.

from dmn-js.

Related Issues (20)

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.