Closed tombelpasso closed 3 years ago
Thank you for the suggestion. This has now been added and pushed to the width_and_fixes
branch. You can now use a .value
property to return the same value as .selected
. Please feel free to checkout the new branch and test.
I tested the suggested branch and fc.value return None, while fc.selected returned the full file path.
Setting the width with fc.layout.width = 'auto' works.
Code:
print(fc.selected_path) print(fc.selected_filename) print(fc.selected) print(fc.value)
Output: C:\Portable\Documents\Python laserRepairNew.ipynb C:\Portable\Documents\Python\laserRepairNew.ipynb None
I'm sorry, but I'm unable to replicate that issue. Here's a recording using your sample code. As you can see, both .selected
and .value
return the proper value:
https://user-images.githubusercontent.com/172588/130286161-268d92b2-d5da-4a8d-94d2-2716ad0f52db.mov
I did notice an issue with the width fix however which now causes rendering issues when the selected path becomes too long and the buttons are not showing their full text as a result anymore. I'll have to revisit the earlier fix to find a better way to handle this so it doesn't break.
Update: updated the layout code so both button do not resize below a certain mininum width and button labels always remain fully visible.
v0.5.0 has now been published to PyPi. Conda-forge feedstock release will follow shortly. Thanks again for reporting this issue and helping to make the project better!
Most ipywidgets have a 'value' attribute. The 'selected' property naming makes sense for the chooser, but even drop down selectors have 'value' .