Skip to content
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

Increment/Decrement Integer on Site AS Number Does not Function (Chrome/Safari) #3876

Closed
jvanderaa opened this issue Jan 9, 2020 · 4 comments · Fixed by #3879
Closed

Increment/Decrement Integer on Site AS Number Does not Function (Chrome/Safari) #3876

jvanderaa opened this issue Jan 9, 2020 · 4 comments · Fixed by #3879
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@jvanderaa
Copy link
Contributor

Environment

  • Python version: 3.6.8
  • NetBox version: v2.7 beta1 & v2.7 beta2

Steps to Reproduce

A. Open Google Chrome 79.0.3945.88 (MacOS)

  1. Go to sites
  2. Edit a site
  3. Click on the integer increment button

Firefox works just fine. Safari has a whole different issue (report coming soon). Not sure if this is a browser function or a function of a library Netbox uses?

Expected Behavior

Expected to have the integers increment and decrement based on number of mouse clicks.

Observed Behavior

The number stays the same

@hSaria
Copy link
Contributor

hSaria commented Jan 9, 2020

This currently happens on the latest stable version, v2.6.11.

@hSaria
Copy link
Contributor

hSaria commented Jan 9, 2020

This seems to be caused by the min and max attributes being set to absurdly high numbers due to the ASNField inheriting from models.BigIntegerField.

<input type="number" name="asn" min="-9223372036854775808" max="9223372036854775807" class="form-control" placeholder="ASN" id="id_asn">

@jeremystretch jeremystretch changed the title Chrome - Increment/Decrement Integer on Site AS Number Does not Function Increment/Decrement Integer on Site AS Number Does not Function (Chrome/Safari) Jan 9, 2020
@jeremystretch
Copy link
Member

absurdly high numbers

Well excuse me for future-proofing! 😛

The root issue is that we use a BigInt for the field (dcim.fields.ASNField) to hold a 32-bit value, which does have intelligent min/max values defined, however they aren't getting replicated to the field's widget. We should be able to set these widget attributes directly on ASNField.

@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application labels Jan 9, 2020
@hSaria
Copy link
Contributor

hSaria commented Jan 9, 2020

No need to set them via the widget. Check out #3879.

Well excuse me for future-proofing!

Yeah, just accounting for the day we start handing out ASNs to every household.

jeremystretch added a commit that referenced this issue Jan 9, 2020
This was referenced Jan 9, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants