[Support request] Hide title -Disable Elements anomaly

Home Forums Support [Support request] Hide title -Disable Elements anomaly

Home Forums Support Hide title -Disable Elements anomaly

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #2010030
    vast

    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.

    #2010131
    Leo
    Staff
    Customer Support

    Hi there,

    Does this issue occur if you use activate parent theme to test?

    Let me know 🙂

    #2010149
    vast

    Hi Leo,

    Can you elaborate on “Does this issue occur if you use activate parent theme to test?”?

    #2010152
    Leo
    Staff
    Customer Support

    There 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.

    #2010176
    vast

    To 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.

    #2010237
    Leo
    Staff
    Customer Support

    To 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.

    #2010416
    vast

    Deactivating the child theme and enabling the parent theme does not change the behavior.

    #2011707
    Tom
    Lead Developer
    Lead Developer

    Strange – 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?

    #2011764
    vast

    Hi 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

    #2012731
    Tom
    Lead Developer
    Lead Developer

    Very 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.

    #2013605
    vast

    Thanks Tom. Is there a dependency on a particular version of jQuery?

    #2013870
    Tom
    Lead Developer
    Lead Developer

    It should just use the version packaged with WordPress – it’s not doing anything overly special.

    #2013961
    vast

    Thanks 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: {…}, …}).

    #2016715
    Tom
    Lead Developer
    Lead Developer

    No, 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.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.