diff --git a/CHANGELOG.md b/CHANGELOG.md index b4e86b8d9c54a..e2193cc4ad2d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,11 @@ ## New Features: -* Make `Blocks.load` behave like other event listeners (allows chaining `then` off of it) [@anentropic](https://github.com/anentropic/) in [PR 4304](https://github.com/gradio-app/gradio/pull/4304) ## Bug Fixes: +- Make `Blocks.load` behave like other event listeners (allows chaining `then` off of it) [@anentropic](https://github.com/anentropic/) in [PR 4304](https://github.com/gradio-app/gradio/pull/4304) +- Respect `interactive=True` in output components of a `gr.Interface` by [@abidlabs](https://github.com/abidlabs) in [PR 4356](https://github.com/gradio-app/gradio/pull/4356). - Remove unused frontend code by [@akx](https://github.com/akx) in [PR 4275](https://github.com/gradio-app/gradio/pull/4275) ## Other Changes: diff --git a/gradio/interface.py b/gradio/interface.py index fd14bbf368835..fa47addc1eced 100644 --- a/gradio/interface.py +++ b/gradio/interface.py @@ -264,8 +264,10 @@ def __init__( ]: for o in self.output_components: assert isinstance(o, IOComponent) - o.interactive = False # Force output components to be non-interactive - + if o.interactive is None: + # Unless explicitly otherwise specified, force output components to + # be non-interactive + o.interactive = False if ( interpretation is None or isinstance(interpretation, list) diff --git a/test/test_interfaces.py b/test/test_interfaces.py index ade45d9dcf21e..40ae287c88c08 100644 --- a/test/test_interfaces.py +++ b/test/test_interfaces.py @@ -160,6 +160,14 @@ def test_inline_display(self, mock_display): assert mock_display.call_count == 2 interface.close() + def test_setting_interactive_false(self): + output_textbox = Textbox() + Interface(lambda x: x, "textbox", output_textbox) + assert not output_textbox.get_config()["interactive"] + output_textbox = Textbox(interactive=True) + Interface(lambda x: x, "textbox", output_textbox) + assert output_textbox.get_config()["interactive"] + class TestTabbedInterface: def test_tabbed_interface_config_matches_manual_tab(self):