Fix rendering of copyable text input widgets.

Review Request #12465 — Created July 12, 2022 and submitted

Information

Djblets
release-3.x

Reviewers

The copyable text input widget (used for things like auto-generated IDs)
wasn't rendering properly. The major problem here is that Django changed
internally how things like the TextInput widget rendered. What was
happening is that even calling the superclass' render() method, it was
using self.template_name. This would render two copies of the copyable
text input widget template, one of which didn't have the correct
context. I've changed it to explicitly render the text input template.

We also had a CSS precedence issue which was causing the copy icon to be
rendered in blue. I've made the CSS rule for this icon to be a bit
higher priority so it doesn't get overridden.

  • Used the OAuth application edit form (which uses this widget in a
    couple different ways) and saw the correct result rather than having
    no text boxes and two copy icons.
  • Ran unit tests on all supported versions of Python.
Summary ID
Fix rendering of copyable text input widgets.
The copyable text input widget (used for things like auto-generated IDs) wasn't rendering properly. The major problem here is that Django changed internally how things like the `TextInput` widget rendered. What was happening is that even calling the superclass' `render()` method, it was using `self.template_name`. This would render two copies of the copyable text input widget template, one of which didn't have the correct context. I've changed it to explicitly render the text input template. We also had a CSS precedence issue which was causing the copy icon to be rendered in blue. I've made the CSS rule for this icon to be a bit higher priority so it doesn't get overridden. Testing Done: Used the OAuth application edit form (which uses this widget in a couple different ways) and saw the correct result rather than having no text boxes and two copy icons.
f208dd0e506f7a8a837d18afe4eaa8e2ccf1ca8d
Description From Last Updated

Can you verify whether unit tests pass for Python 3.7-3.10?

chipx86chipx86
chipx86
  1. 
      
  2. Show all issues

    Can you verify whether unit tests pass for Python 3.7-3.10?

  3. 
      
david
maubin
  1. Ship It!
  2. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.x (1891f75)
Loading...