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

fix: parse decimal size #453

Merged
merged 1 commit into from
Mar 3, 2023
Merged

fix: parse decimal size #453

merged 1 commit into from
Mar 3, 2023

Conversation

wadjih-bencheikh18
Copy link
Member

closes : #450

the problem was in parseSize function

I had two solution

  • Update the old regex :
const [, value, type] = /(?<value>^\d+\.?\d+)(?<type>.+)$/.exec(
 initialSize,
) as unknown as [string, string, SplitPaneType];
  • Get float from the parsed string then extract type by deleting the rest
const value = Number.parseFloat(initialSize);
const type = initialSize.replace(/[\d .]/g, '') as SplitPaneType;

I prefer the second one, which is implemented in this PR

@wadjih-bencheikh18 wadjih-bencheikh18 linked an issue Mar 3, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (4af016d) 53.22% compared to head (2e0fddc) 53.22%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #453   +/-   ##
=======================================
  Coverage   53.22%   53.22%           
=======================================
  Files         137      137           
  Lines        7356     7356           
  Branches      171      171           
=======================================
  Hits         3915     3915           
  Misses       3441     3441           
Impacted Files Coverage Δ
src/components/split-pane/SplitPane.tsx 38.38% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lpatiny lpatiny requested a review from targos March 3, 2023 13:05
@lpatiny lpatiny merged commit cb0da96 into main Mar 3, 2023
@lpatiny lpatiny deleted the 450-vertical-splitter-freeze branch March 3, 2023 13:50
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.

Vertical splitter freeze
3 participants