Fix/4060 download button#4145
Conversation
When `allowDownload` is enabled and a text or email file cannot be rendered, the fallback "unsupported file type" message rendered its own download button on top of the one already shown in the controls bar, resulting in two download buttons.
📝 WalkthroughWalkthrough
Changesfile-viewer duplicate download and button positioning fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Documentation has been published to https://lundalogik.github.io/lime-elements/versions/PR-4145/ |
|
yeah, missed the number , should be 4070 instead... |
| * @param withDownloadButton whether to render a download button as a | ||
| * recovery option. Should be `false` when the message is shown as | ||
| * fallback content alongside the buttons bar, which already renders its | ||
| * own download button, to avoid showing two download buttons. | ||
| */ |
There was a problem hiding this comment.
The JSDoc says the buttons bar "already renders its own download button," but it only does so when allowDownload is true. If we want to be precise maybe "...which already renders the download button when enabled" so it doesn't imply the button is unconditional.
| * fallback content alongside the buttons bar, which already renders its | ||
| * own download button, to avoid showing two download buttons. | ||
| */ | ||
| private renderNoFileSupportMessage = (withDownloadButton = true) => { |
There was a problem hiding this comment.
Worth adressing to get it cleared
fix: #4070
Summary by CodeRabbit
Bug Fixes
Review:
Browsers tested:
(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)
Windows:
Linux:
macOS:
Mobile: