Git Product home page Git Product logo

Comments (6)

alesnav avatar alesnav commented on August 28, 2024

Testing it and found one minibug:

jsfiddle: http://jsfiddle.net/kE2Ut/2/

The same code with main branch works fine; but in this case, using the dev branch, throws the following error:

"Uncaught TypeError: Cannot call method 'css' of null"

Anyway, it is shown via javascript console, but nothing happens on the web aparently, i mean, you won't see any error in the web without opening the javascript console. It seems that it tries to change something on css after hide tooltip, instead of before.

Can you please check this?

Thanks!

EDIT: If you click on "Open fancybox", then click on "OK!" without filling any input and finally write something in one of them, you will see the same error: "Uncaught TypeError: Cannot call method 'css' of null"

from tooltipster.

alesnav avatar alesnav commented on August 28, 2024

One more thing that happens only using the dev branch:

jsfiddle: http://jsfiddle.net/kE2Ut/3/

I've added a new condition to validate the second field: it must be a number.

Steps to reproduce the problem:
1.- Click on Open fancybox
2.- Fill in the second field (edit2) with, for example "a"
3.- Click on the other field. A tooltip will be shown because "a" is not a number, but that tooltip will be placed in the middle of the form, instead of on the right of the field affected.
4.- Now, if you write something in the other field (edit1), leaving the other field filled with "a", and click "OK!", both tooltips are placed in the right position.

So, this bug will appear only if one tooltip is shown.

Thanks!

P.D.: if I change the line "$(element).tooltipster('update', $(error).text());" by "$(element).tooltipster('content', $(error).text());", the bug is also there

P.D.2.: anyway, this tool is awesome! :)

from tooltipster.

louisameline avatar louisameline commented on August 28, 2024

Hello alesnav, thanks for feedback and support !

So we have 2 issues here : the error thrown and the positioning.

About the error, your validation plugin calls the errorPlacement and success callbacks twice for each input when something is typed, which is already weird. It currently results in showing/hiding/showing/hiding the tooltip and because of Tooltipster's animation timeouts, it messes things up (although it shouldn't if Tooltipser was flawless ;)

I already saw and fixed a bug thanks to you, but we still have some work on our end to manage these timeouts better and solve the issue for good.

But you can also improve things in your own code to work around the issue : when the error message is an empty string, do not call Tooltipster's show method, but rather its hide method (or nothing at all since success() will take care of it). As for your callbacks being called twice, I don't know if you can do something about it as I am not sure if this behavior comes from the validation plugin or from the way you implemented it.

You can see it work here : http://jsfiddle.net/kE2Ut/7/

FYI, you saw no issue in the previous version of Tooltipster because putting an empty string in a Tooltip would hide the tooltip, but now an empty string is considered content strictly speaking (only NULL represents a lack of content now).

Now about the positioning (in Chrome only it seems), it's duly noted, we have other things to rewrite in there anyway when we can.

Thanks

from tooltipster.

louisameline avatar louisameline commented on August 28, 2024

First issue fixed. I'll open a new issue with the positioning bug to have 1 thread per bug.

from tooltipster.

alesnav avatar alesnav commented on August 28, 2024

Thanks louisameline,

First issue fixed, confirmed :)

from tooltipster.

louisameline avatar louisameline commented on August 28, 2024

Version 3.0 is out, feedback is welcome.

from tooltipster.

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.