Skip to content

fix: align max click value with displayed formatted size (fixes #226)#244

Open
jiangyj545 wants to merge 1 commit into
capofficial:mainfrom
jiangyj545:fix/close-position-max-size-226
Open

fix: align max click value with displayed formatted size (fixes #226)#244
jiangyj545 wants to merge 1 commit into
capofficial:mainfrom
jiangyj545:fix/close-position-max-size-226

Conversation

@jiangyj545
Copy link
Copy Markdown

Summary

Fixes #226 — Close Position modal: clicking Max now populates the input with the formatted display value instead of the raw position size.

Problem

The "Max" label displays formatForDisplay(data.size) (e.g., 1,234.57 ETH), but on:click set amount = data.size (raw unformatted value like 1234.56789012). This caused a mismatch between what the user saw and what appeared in the input field.

Change

File: src/components/modals/ClosePosition.svelte (line 99)

```diff

  • on:click={() => amount = data.size}
  • on:click={() => amount = formatForDisplay(data.size)}
    ```

Verification

  • `npx rollup -c` ✅ builds successfully
  • Clicking Max now shows the same clean number in the input as displayed in the Max label

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