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

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

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

Comments

Projects
None yet
4 participants
@pseudonom
  • 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.

@davidbailey00

This comment has been minimized.

Show comment
Hide comment
@davidbailey00

davidbailey00 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-----
-----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 markelog added the Dimensions label Nov 9, 2014

@markelog

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Nov 9, 2014

Member

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 ?

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

This comment has been minimized.

Show comment
Hide comment
@dmethvin

dmethvin Nov 11, 2014

Member

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

Member

dmethvin commented Nov 11, 2014

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

@markelog markelog closed this in f7e60dc Nov 16, 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

@cssmagic cssmagic referenced this issue May 18, 2016

Open

jQuery #5

@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.