Skip to content

DYN-4783: Do not allow non integer input in integer slider node - #17213

Draft
ivaylo-matov wants to merge 4 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-4783-Do-not-allow-non-integer-input-in-Integer-Slider-node_
Draft

DYN-4783: Do not allow non integer input in integer slider node #17213
ivaylo-matov wants to merge 4 commits into
DynamoDS:masterfrom
ivaylo-matov:DYN-4783-Do-not-allow-non-integer-input-in-Integer-Slider-node_

Conversation

@ivaylo-matov

Copy link
Copy Markdown
Contributor

Purpose

DYN-4783: Do not allow non-integer input in Integer Slider node.

IntegerSlider64Bit's Min/Max/Step/Value fields currently accept decimals and letters without validation (silently coercing or parsing with a too-narrow int.TryParse), with no feedback to the user. This PR fixes that with two changes:

  1. IntegerSlider64Bit.UpdateValueCore : strict integer-literal validation. Non-integer input (decimals, letters) is rejected: the last valid value is kept. A well-formed integer literal that's simply too large/small for Int64 is still accepted and clamped to Int64.MaxValue/MinValue (preserving existing behavior), with the existing range-overflow message.
  2. DynamoSlider.xaml.cs : blocks non-integer keystrokes/paste at the UI level, scoped to IntegerSlider64Bit only (this control is shared with DoubleSlider and the legacy 32-bit IntegerSlider, both intentionally left unaffected).

Changes:

  • src/Libraries/CoreNodeModels/Input/IntegerSlider.cs (IntegerSlider64Bit only) : validation/clamp logic above; removed dead code (UpdateNodeInfo, SliderBase.IsValueInt64).
  • src/Libraries/CoreNodeModelsWpf/Controls/DynamoSlider.xaml.cs : keystroke/paste filter.
  • New resource IntegerSliderNonIntegerInputMessage : "The input must be an integer.".
  • Tests added in test/DynamoCoreWpf3Tests/SliderTests.cs and new test/DynamoCoreWpf3Tests/DynamoSliderTests.cs. Existing SliderMaxResetsToIntMax/SliderMinResetsToIntMin/TestIntSliderInfoState still pass unmodified since clamping is preserved.

Declarations

Check these if you believe they are true

Release Notes

Integer Slider no longer accepts decimal or non-numeric text in its Min/Max/Step/Value fields; invalid input is blocked and an info message is shown. Values that are valid integers but exceed the supported range are still clamped to the nearest supported value, as before.

Reviewers

@DynamoDS/eidos
@johnpierson
@RobertGlobant20

FYIs

@dnenov
@jnealb
@eamiri

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-4783

- pass time stamp to IntegerInputPattern
- static methods in DynamoSlider
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@ivaylo-matov
ivaylo-matov marked this pull request as draft July 16, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant