Only render preview if picker has a preview function (#8667)
This commit is contained in:
parent
7d7ed78681
commit
d0430f1c81
1 changed files with 2 additions and 1 deletions
|
@ -795,7 +795,8 @@ impl<T: Item + 'static + Send + Sync> Component for Picker<T> {
|
||||||
// | | | |
|
// | | | |
|
||||||
// +---------+ +---------+
|
// +---------+ +---------+
|
||||||
|
|
||||||
let render_preview = self.show_preview && area.width > MIN_AREA_WIDTH_FOR_PREVIEW;
|
let render_preview =
|
||||||
|
self.show_preview && self.file_fn.is_some() && area.width > MIN_AREA_WIDTH_FOR_PREVIEW;
|
||||||
|
|
||||||
let picker_width = if render_preview {
|
let picker_width = if render_preview {
|
||||||
area.width / 2
|
area.width / 2
|
||||||
|
|
Loading…
Add table
Reference in a new issue