From 0beb095a4bfbcce55acb016eaaa54b5e93a56023 Mon Sep 17 00:00:00 2001 From: Zach Flanders Date: Mon, 7 Nov 2022 15:37:36 -0600 Subject: Fix spoiler buttons css not rendering correct color in light theme (#19960) * Updating status__content__spoiler-link css for mastodon-light theme to ensure correct rendering precedence * Adding focus css selector to status__content__spoiler-link mastodon-light theme * reformatting code to match convention of having css selectors on separate lines * fixing code format for scss linting issue --- app/javascript/styles/mastodon-light/diff.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/styles/mastodon-light/diff.scss b/app/javascript/styles/mastodon-light/diff.scss index d928a55ed..d960070d6 100644 --- a/app/javascript/styles/mastodon-light/diff.scss +++ b/app/javascript/styles/mastodon-light/diff.scss @@ -268,7 +268,8 @@ html { .status__content .status__content__spoiler-link { background: $ui-base-color; - &:hover { + &:hover, + &:focus { background: lighten($ui-base-color, 4%); } } -- cgit From 608343c135c087ab7fa9bd401dce8a705720fdb8 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 8 Nov 2022 03:52:52 +0100 Subject: Fix opening the language picker scrolling the single-column view to the top (#19983) Fixes #19915 --- .../mastodon/features/compose/components/language_dropdown.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/compose/components/language_dropdown.js b/app/javascript/mastodon/features/compose/components/language_dropdown.js index e48fa60ff..bf56fd0fa 100644 --- a/app/javascript/mastodon/features/compose/components/language_dropdown.js +++ b/app/javascript/mastodon/features/compose/components/language_dropdown.js @@ -51,6 +51,15 @@ class LanguageDropdownMenu extends React.PureComponent { document.addEventListener('click', this.handleDocumentClick, false); document.addEventListener('touchend', this.handleDocumentClick, listenerOptions); this.setState({ mounted: true }); + + // Because of https://github.com/react-bootstrap/react-bootstrap/issues/2614 we need + // to wait for a frame before focusing + requestAnimationFrame(() => { + if (this.node) { + const element = this.node.querySelector('input[type="search"]'); + if (element) element.focus(); + } + }); } componentWillUnmount () { @@ -226,7 +235,7 @@ class LanguageDropdownMenu extends React.PureComponent { // react-overlays
- +
-- cgit From 782b6835f786385c41c6455f2a251d1925b19eb5 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 8 Nov 2022 04:06:54 +0100 Subject: Fix redrafting a currently-editing post not leaving edit mode (#20023) --- app/javascript/mastodon/reducers/compose.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/reducers/compose.js b/app/javascript/mastodon/reducers/compose.js index e4601e471..ad384bd0b 100644 --- a/app/javascript/mastodon/reducers/compose.js +++ b/app/javascript/mastodon/reducers/compose.js @@ -452,6 +452,7 @@ export default function compose(state = initialState, action) { map.set('idempotencyKey', uuid()); map.set('sensitive', action.status.get('sensitive')); map.set('language', action.status.get('language')); + map.set('id', null); if (action.status.get('spoiler_text').length > 0) { map.set('spoiler', true); -- cgit From 6eac1cfccdc497c4f022689cd73bf937d0607f36 Mon Sep 17 00:00:00 2001 From: Zach Flanders Date: Mon, 7 Nov 2022 15:37:36 -0600 Subject: [Glitch] Fix spoiler buttons css not rendering correct color in light theme Port 0beb095a4bfbcce55acb016eaaa54b5e93a56023 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/mastodon-light/diff.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss b/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss index 37a49ce9f..1fe3d7a51 100644 --- a/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss +++ b/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss @@ -268,7 +268,8 @@ html { .status__content .status__content__spoiler-link { background: $ui-base-color; - &:hover { + &:hover, + &:focus { background: lighten($ui-base-color, 4%); } } -- cgit From fe1b69412880634d8d20e0af2c847cab37169d59 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 8 Nov 2022 03:52:52 +0100 Subject: [Glitch] Fix opening the language picker scrolling the single-column view to the top Port 608343c135c087ab7fa9bd401dce8a705720fdb8 to glitch-soc Signed-off-by: Claire --- .../glitch/features/compose/components/language_dropdown.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js b/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js index 31f1d4e73..a3256aa9b 100644 --- a/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js +++ b/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js @@ -51,6 +51,15 @@ class LanguageDropdownMenu extends React.PureComponent { document.addEventListener('click', this.handleDocumentClick, false); document.addEventListener('touchend', this.handleDocumentClick, listenerOptions); this.setState({ mounted: true }); + + // Because of https://github.com/react-bootstrap/react-bootstrap/issues/2614 we need + // to wait for a frame before focusing + requestAnimationFrame(() => { + if (this.node) { + const element = this.node.querySelector('input[type="search"]'); + if (element) element.focus(); + } + }); } componentWillUnmount () { @@ -226,7 +235,7 @@ class LanguageDropdownMenu extends React.PureComponent { // react-overlays
- +
-- cgit From 9b6d6a919f3bd908fbdf3efc9aa5d97d33e3fe6e Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 8 Nov 2022 04:06:54 +0100 Subject: [Glitch] Fix redrafting a currently-editing post not leaving edit mode Port 782b6835f786385c41c6455f2a251d1925b19eb5 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/reducers/compose.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index b739456da..460af3955 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -573,6 +573,7 @@ export default function compose(state = initialState, action) { 'advanced_options', map => map.merge(new ImmutableMap({ do_not_federate })) ); + map.set('id', null); if (action.status.get('spoiler_text').length > 0) { map.set('spoiler', true); -- cgit