Add some clarifying comments

pull/21833/head
Travis Ralston 2019-05-20 20:41:48 -06:00
parent 332f716ce4
commit 52b0f285c6
3 changed files with 18 additions and 1 deletions

View File

@ -110,6 +110,10 @@ textarea {
color: $primary-fg-color;
}
// This is used to hide the standard outline added by browsers for
// accessible (focusable) components. Not intended for buttons, but
// should be used on things like focusable containers where the outline
// is usually not helping anyone.
.mx_HiddenFocusable {
outline: none;
}

View File

@ -323,6 +323,10 @@ const LoggedInView = React.createClass({
}
break;
case KeyCode.KEY_I:
// Ideally this would be CTRL+P for "Profile", but that's
// taken by the print dialog. CTRL+I for "Information"
// will have to do.
if (ctrlCmdOnly) {
dis.dispatch({
action: 'toggle_top_left_menu',

View File

@ -14,6 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
/**
* Automatically focuses the captured reference when receiving a non-null
* object. Useful in scenarios where componentDidMount does not have a
* useful reference to an element, but one needs to focus the element on
* first render. Example usage: ref={focusCapturedRef}
* @param ref The React reference to focus on, if not null
*/
export function focusCapturedRef(ref) {
if (ref) ref.focus();
if (ref) {
ref.focus();
}
}