Git Product home page Git Product logo

Comments (6)

jeremydean avatar jeremydean commented on May 27, 2024

Just a quick additional note/clue, selecting text and then instead clicking the annotate button in the sidebar does work here: the composition window opens in the sidebar and the selected text appears as the target.

from client.

sean-roberts avatar sean-roberts commented on May 27, 2024

There is definitely an override happening on their site. One that seems to only pass through 1 argument to the click event listener instead of the two that we are binding. It would require a little more digging but this seems like something we can easily rethink how we do the event listeners.

from client.

sean-roberts avatar sean-roberts commented on May 27, 2024

So my branch fixes this issue of the preventDefault. But, it uncovered the next breaking problem with that website. The set the display:none property on the button that is being clicked in that panel. That will hide the "Annotate" or "Highlight" button in the adder (depending on which one was used). This is them making a big assumption about what is being used there. So additional work will be needed to make sure the display is not changed as well

from client.

sean-roberts avatar sean-roberts commented on May 27, 2024

Add assurance of display being set to block in my branch which fixes the second issue they have.

from client.

robertknight avatar robertknight commented on May 27, 2024

The interfering Function.prototype.bind implementation is being installed by MooTools 1.2.5 apparently (evaluate MooTools.version in the console), and specifically this code: https://github.com/mootools/mootools-core/blob/3e7459cb4756475a80921bfde5c19a7c7edb64df/Source/Native/Function.js#L28

It looks like this issue applies to any page which uses either MooTools <= 1.2.x OR includes the 1.2.x compatibility code.

Minimal example:

<html>
  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mootools/1.6.0/mootools-core-compat.js"></script>
  </head>
<body>
  <button id="btn">Click me</button>
<script>
function annotate(command, event) {
  console.log(`Annotate should have been called with 2 arguments but was called with ${arguments.length} args`, arguments);
}

var btn = document.getElementById('btn');
btn.addEventListener('click', annotate.bind(null, 'annotate'));
</script>

</body>
</html>

from client.

sean-roberts avatar sean-roberts commented on May 27, 2024

Sorry about the commit spamming above

This is fixed with client release 0.46.0

from client.

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.