Skip to content

Updating coordinate object in function form of offset causes silent failure #1848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pseudonom opened this issue Nov 9, 2014 · 3 comments
Closed

Comments

@pseudonom
Copy link

  • jQuery version: Through 2.1.1
  • Browser: Chromium 38.0.2125.101 and Firefox 33.0
  • OS: Debian Sid
  • Expected behavior:
$(el).offset(function(_, ofs){
      ofs.top += 10;
      return ofs;
});

Should move el down by 10 pixels. If that's somehow impossible, jQuery should at least raise an error.

@vtenfys
Copy link

vtenfys commented Nov 9, 2014

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

This is very weird. Just one line is making the whole thing go
bad, and I can't figure out at all why. Updated JSFiddle using a
nightly build: http://jsfiddle.net/robocoder_db/dwq2wf0y/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCgAGBQJUXym+AAoJEFzScnC7IY6D7PQP/A+YMRc9pfTO+/jlpW9QdP92
mrxK6BcY7vapoml2EC+xMM5tpMqpi0rYXaz5d/nDBZ8TJUOco1q1DfRAJyEuMb7w
xpg5Dp88nWq1ViGMlDdEErSvWrqhsWC7II0quMUQ3G8weCzI8BpRGKs5T1ghXt4v
zF4Fga1FvZDR0S/n/TmN+yeMaylo52TdeeWtTjoUJeiaNw6yWyog4Cxjhzfv73C+
mKEnbCSKps8mxM/WLUVZ1nKE0CWG1e+DzPQtyL+l7VRrRJpGgJjBlNVagSA2YdoJ
yz1BW4/gmnQvRwPSHofblSulFMdV1SiGLb+02RRVKBWNg3vIRD8jjwHOFdtMfMyn
7RONODVQEsRduzAcnz5dEaIJcjj7rwCsD71LoX+GcjCOEP4rk+lKnfT7zf+q7YWh
+fnZN0yHwY9lzB/q1teUKb4AdbAWTn3su/R94M+PNOpTVA0HJJHMRsO7GyUVVO5v
+HQm6Tj36qz67uKC+rD6dElZpaqDyd2uvDTh7+6xmWkX0/pfeGT3+D8ZHKzaEyWN
T/Qpx3vhq18zWj7dCoQ5HHI0VLlC5CFsXdspgcHb6ovRVfF2PdVPCijlJMRbLQrX
1i+kr9vQVRRphYZ+EPWVd9DsYsy+ogT1asunBuAOOXcGRfo+BysX1ncItiZSvz2b
OKHlcyh74JFWfhmSVfdc
=Ivvx
-----END PGP SIGNATURE-----

@markelog
Copy link
Member

markelog commented Nov 9, 2014

Second argument is current position of the element that should not be modified.

We could either fix this through doc notes or with one-liner in the offset module.

@dmethvin ?

@dmethvin
Copy link
Member

I can see the lure of modifying the incoming position object, so it seems like we should allow that.

@dmethvin dmethvin added this to the 3.0.0 milestone Nov 11, 2014
markelog added a commit to markelog/jquery that referenced this issue Nov 11, 2014
@dmethvin dmethvin added the Bug label Dec 8, 2014
@dmethvin dmethvin modified the milestones: 1.12/2.2, 3.0.0 Jan 7, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

4 participants