- This topic has 13 replies, 3 voices, and was last updated 2 years, 5 months ago by Tom.
-
AuthorPosts
-
November 18, 2021 at 1:17 pm #2010030vast
Hi there,
When the ‘Disable elements’ is first activated, an eye icon appears next to the icon. After exiting a page/post and when editing it again, the eye icon disappears. There is still the option to disable an element in the layout metabox.
Oddly, the icon reappears if a change is made to the functions file e.g. remove a statement. For example removing the block of code below.
function generatepress_child_enqueue_scripts() { if ( is_rtl() ) { wp_enqueue_style( 'generatepress-rtl', trailingslashit( get_template_directory_uri() ) . 'rtl.css' ); } } add_action( 'wp_enqueue_scripts', 'generatepress_child_enqueue_scripts', 100 );
It appears briefly and the same issue occurs if the page/post is edited. If the block of code is added back in again, the icon appears and then disappears again.
There are no other blocks of code in the functions.php file.
November 18, 2021 at 2:50 pm #2010131LeoStaffCustomer SupportHi there,
Does this issue occur if you use activate parent theme to test?
Let me know 🙂
November 18, 2021 at 3:01 pm #2010149vastHi Leo,
Can you elaborate on “Does this issue occur if you use activate parent theme to test?”?
November 18, 2021 at 3:03 pm #2010152LeoStaffCustomer SupportThere are no other blocks of code in the functions.php file.
This suggests that you are using a child theme and I’m asking if you can activate the parent theme to test.
November 18, 2021 at 3:27 pm #2010176vastTo be clear, are you suggesting to deactivate the child theme? The reason the child theme is activated is because there will be functions we’ll be introducing.
November 18, 2021 at 5:16 pm #2010237LeoStaffCustomer SupportTo be clear, are you suggesting to deactivate the child theme?
Yes – for testing and debugging purpose.
You can also create a staging site if this is a live site with traffic.
November 18, 2021 at 9:56 pm #2010416vastDeactivating the child theme and enabling the parent theme does not change the behavior.
November 19, 2021 at 6:03 pm #2011707TomLead DeveloperLead DeveloperStrange – the eye you’re seeing is a core theme feature. It definitely shouldn’t care whether you make a change to your child theme.
Are there any console errors when it disappears?
November 19, 2021 at 9:50 pm #2011764vastHi Tom,
There are no console errors. Isn’t the icon added by GeneratePress as a shortcut – https://generatepress.com/gutenberg/?
From testing, we’ve noticed the following:
1) The icon appears when logging into WordPress followed by editing a page. When exiting the page and re-entering to edit it, the icon disappears.2) The icon appears consistently if the Chrome web developer tools window is open prior to editing the page. The icon appears when toggling all available screen sizes.
3) The icon appears when a change is made to the child theme functions file followed by editing a page. When exiting the page and re-entering to edit it, the icon disappears.
This occurs across all browser types e.g. Firefox, Chromium
November 20, 2021 at 8:52 pm #2012731TomLead DeveloperLead DeveloperVery strange – it’s added using javascript after the page loads: https://github.com/tomusborne/generatepress/blob/3.1.0/assets/js/admin/block-editor.js#L85
It’s possible that something is interfering on your end (a plugin, server caching, etc…). I’m not able to get it to happen on my end, unfortunately.
It’s something we will likely be improving (or removing) in the near future as we move away from jQuery.
November 21, 2021 at 11:50 am #2013605vastThanks Tom. Is there a dependency on a particular version of jQuery?
November 21, 2021 at 5:46 pm #2013870TomLead DeveloperLead DeveloperIt should just use the version packaged with WordPress – it’s not doing anything overly special.
November 21, 2021 at 9:08 pm #2013961vastThanks Tom. Does the function use blocks.min.js?
If yes, the console window generates the following output when it doesn’t display the eye icon.
Block successfully updated for
core/button
(ObjectapiVersion: 2attributes: {url: {…}, title: {…}, text: {…}, linkTarget: {…}, rel: {…}, …}category: “design”deprecated: (8) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]description: “Prompt visitors to take action with a button-style link.”edit: Æ’ (e)example: {attributes: {…}}getEditWrapperProps: n=>{let o={};return t&&(o=t(n)),Lc(o,e,n)}icon: {src: {…}}keywords: [“link”]merge: (e,{text:t=””})=>({…e,text:(e.text||””)+t})name: “core/button”parent: [“core/buttons”]providesContext: {}save: Æ’ ({attributes:e,className:t})styles: (2) [{…}, {…}]supports: {anchor: true, align: true, alignWide: false, color: {…}, typography: {…}, …}title: “Button”usesContext: []variations: []__proto__: Object).In contrast, the console window displays the results below when the eye icon is shown.
Block successfully updated for
core/button
({name: “core/button”, icon: {…}, keywords: Array(1), attributes: {…}, providesContext: {…}, …}).November 22, 2021 at 8:54 pm #2016715TomLead DeveloperLead DeveloperNo, those are core deprecation notices letting you know they’ve updated a block on the page.
This particular code is handed in the
block-editor.js
file in the theme directory. My guess is that something is delaying the loading of the metabox that the theme checks for before adding the eye. If the metabox option doesn’t exist, the eye is useless and the theme doesn’t add it. -
AuthorPosts
- You must be logged in to reply to this topic.