@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Autofocus form control for adding TOTP codes

Summary: Ref D20122. This is something I wanted in a bunch of places. Looks like at some point the most-annoying one (autofocus for entering TOTOP codes) already got fixed at some point.

Test Plan: Loaded the form, got autofocus as expected.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D20128

+12
+1
src/applications/auth/factor/PhabricatorTOTPAuthFactor.php
··· 128 128 ->setLabel(pht('TOTP Code')) 129 129 ->setName('totpcode') 130 130 ->setValue($code) 131 + ->setAutofocus(true) 131 132 ->setError($e_code)); 132 133 133 134 }
+11
src/view/form/control/PHUIFormNumberControl.php
··· 3 3 final class PHUIFormNumberControl extends AphrontFormControl { 4 4 5 5 private $disableAutocomplete; 6 + private $autofocus; 6 7 7 8 public function setDisableAutocomplete($disable_autocomplete) { 8 9 $this->disableAutocomplete = $disable_autocomplete; ··· 11 12 12 13 public function getDisableAutocomplete() { 13 14 return $this->disableAutocomplete; 15 + } 16 + 17 + public function setAutofocus($autofocus) { 18 + $this->autofocus = $autofocus; 19 + return $this; 20 + } 21 + 22 + public function getAutofocus() { 23 + return $this->autofocus; 14 24 } 15 25 16 26 protected function getCustomControlClass() { ··· 34 44 'disabled' => $this->getDisabled() ? 'disabled' : null, 35 45 'autocomplete' => $autocomplete, 36 46 'id' => $this->getID(), 47 + 'autofocus' => ($this->getAutofocus() ? 'autofocus' : null), 37 48 )); 38 49 } 39 50